PROBLEM A
Wily Hacke's Problem

Input File Name: A.INP
Source File Name: A.PAS or A.C or A.CPP

	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:
	-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.
	EXAMPLE
	Suppose that the input file consisted of the following cryptograms 
and  keys:

85bfa0242caa796e    1111222233334444
4c0d17279cbf4222    abcdabcdabcdabcd

	The output would look like this:
TEACHERS
STUDENTS