Problem4497--数字加密

4497: 数字加密

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

对一个十进制的四位数来说,我们用以下规则将它加密成另一个四位数:

  • 首先,将个位和千位对调;
  • 然后,将十位和百位对调;
  • 最后将每一位数字进行替换操作。替换规则为:lns="http://www.w3.org/1998/Math/MathML">0 替换成 lns="http://www.w3.org/1998/Math/MathML">9lns="http://www.w3.org/1998/Math/MathML">1 替换成 lns="http://www.w3.org/1998/Math/MathML">8lns="http://www.w3.org/1998/Math/MathML">2 替换成 lns="http://www.w3.org/1998/Math/MathML">7lns="http://www.w3.org/1998/Math/MathML">3 替换成 lns="http://www.w3.org/1998/Math/MathML">6lns="http://www.w3.org/1998/Math/MathML">9 替换成 lns="http://www.w3.org/1998/Math/MathML">0,其他数字以此类推。

例如,对 8429 加密,则

  • 个位和千位对调后得 9428
  • 十位和百位对调后得 9248
  • 将每个数字替换后得 0751

现在给定一个已经被加密过的四位数(称之为密文),请解密出原本的数字(称之为明文)。

Input

单个整数,表示给定的密文,保证输入的密文有且仅有四个数字。



Output

单个整数,表示对应的明文

Sample Input Copy

0751

Sample Output Copy

8429

Source/Category