Problem1088--OMG!

1088: OMG!

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

In cryptography, encryption is the process of encoding messages (or information) in such a way that third parties cannot read it, but only authorized parties can. Encryption doesn't prevent hacking but it prevents the hacker from reading the data that is encrypted. In an encryption scheme, the message or information (referred to as plaintext) is encrypted using an encryption algorithm, turning it into an unreadable ciphertext (ibid.). This is usually done with the use of an encryption key, which specifies how the message is to be encoded. Any adversary that can see the ciphertext should not be able to determine anything about the original message. An authorized party, however, is able to decode the ciphertext using a decryption algorithm, that usually requires a secret decryption key, that adversaries do not have access to. For technical reasons, an encryption scheme usually needs a key-generation algorithm to randomly produce keys.

There are so many ways to encrypt a message. In general, there are two kinds of method: Symmetric key encryption and Public key encryption. In Symmetric-key schemes, the encryption and decryption keys are the same. Thus communicating parties must agree on a secret key before they wish to communicate. But In public-key encryption schemes, the encryption key is published for anyone to use and encrypt messages. However, only the receiving party has access to the decryption key and is capable of reading the encrypted messages. Public-key encryption is a relatively recent invention: historically, all encryption schemes have been symmetric-key (also called private-key) schemes. Likewise, there are many algorithms used in encryption efficiently, such as DES(Data Encryption Standard), 3DES, RC2&RC4, IDEA and so forth. What’s more, you can also define your own rules to encrypt messages. For example, we can define a method named OE which first makes every digit of the number add 9 then mod 10. Then separate the digits in odd positions and the digits in even positions from the new number in their original order, then connect the two parts with the set of digits in odd positions first.

One of the earliest public key encryption applications was called Pretty Good Privacy (PGP). It was written in 1991 by Phil Zimmermann and was purchased by Symantec in 2010.

Encryption is also used to protect data in transit, for example data being transferred via networks (e.g. the Internet, e-commerce), mobile telephones, wireless microphones, wireless intercom systems, Bluetooth devices and bank automatic teller machines. There have been numerous reports of data in transit being intercepted in recent years. Encrypting data in transit also helps to secure it as it is often difficult to physically secure all access to networks.

Digital signature and encryption must be applied at message creation time (i.e. on the same device it has been composed) to avoid tampering. Otherwise any node between the sender and the encryption agent could potentially tamper it. It should be noted that encrypting at the time of creation only adds security if the encryption device itself has not been tampered with.

With the information on encryption above, you also want to encryption some passwords with some ingenious methods and efficient algorithms. To make the problem more easier, your task is to encrypt a number with your own method------OE. Good luck, ACMer!

Input

First line contains a positive integer T(T<=10000). Then T cases follow. Each case contains one line with a positive number N(N<100000000), which stands for the password.

Output

One line for each case, output the password after encrypted in OE method.

Sample Input Copy

2
1257
5321041

Sample Output Copy

0416
4190203

Source/Category