I. 170. Nervous John works as a system administrator for a company. One day he accidentally deleted a program used by his boss, Forgetful Fred. The purpose of that program was to put digital signatures at the end of e-mails: Fred chose a word (``signature'') depending on the content of the mail, wrote it at the end, then used the program to generate a ``code'' from the signature, and wrote the code also at the end of the mail. In order to make sure that a mail has been signed by Fred, he only had to enter the signature into his program and check if the generated code was the same.
Unfortunately, John could recover only 3 e-mails with the following signatures/codes:
Your task is to help John and reconstruct Fred's program. The input should be a signature, then the code, as the output, should be written on the screen. The source code (i170.pas, i170.cpp, ...) should be submitted.
Deadline expired on 17 December 2007.