Wily Hacker finds on his chief’s desk the encryption scheme of the chief’s most important messages (see figure). He also finds, in his chief’s computer, files with cryptograms and the associated encryption keys. He wishes to write a program for decrypting these cryptograms. Wily read a book about modern encryption. He discovered that twenty years ago cryptography became the subject of many applications in the domain of computer data security. More and more persons wish to make their messages and files confidential. A cipher is a secret method of transforming plaintext (message) into ciphertext (cryptogram). This operation, called encryption, is controlled by a encryption key. There must exist the reverse transformation, called decryption, which transforms ciphertext into plaintext using a decryption key, which is derived using the encryption key. Wily observes that the algorithm shown in the figure encrypts the 64-bit message M into the 64-bit cryptogram C, under the control of the 64-bit key K. The encryption function use 3 types of operations: • exclusive-or, marked with the symbol ∧ • addition module 216, marked with the symbol + • left circular shift, with a number of positions indicated by the input K, marked with the symbol < All these functions operate on 16-bit operands. The algorithm uses the following notations:
2/2 • Mi, i=1,4 represents four 16-bit blocks of plaintext; • Ci, i=1,4 represents four 16-bit blocks of cryptogram; • Ki, i=1,4 represents four 16-bit blocks of the encryption key. After much hard work, Wily finds the correct decryption scheme and the method to obtain the decryption keys. Your task is to write a program that obtains plain messages from cryptograms and decryption keys by discovering a suitable scheme, just like Wily Hacker did. Input The input text file should contain several groups of cryptograms and keys. Each line consists of a cryptogram, composed of 16 hexadecimal digits (64 bits) and, after blank characters, the 16 hexadecimal digits (64 bits) of the encryption key. Output On the output, your program will write the ASCII characters of messages (plaintext), one message per line, representing the result of decrypting the messages. Sample Input 85bfa0242caa796e 4c0d17279cbf4222 Sample Output TEACHERS STUDENTS 1111222233334444 abcdabcdabcdabcd