You are a spy sent to DMOJstan to sabotage their internal servers. To keep communications with your nation (WLMOJstan) private, you are issued a one-time pad code book.
The code book and encrypted messages are both strings of numeric digits.
You want to create program to help you decode communications so you can spend more time on espionage.
One-time pad decryption works as follows:
- Split each string into two-digit blocks: each two-digit block in the encrypted message corresponds with a two-digit block at the same position in the code book.
- Subtract the first block in the encrypted message by the first block in the code book.
- Find the character at position () of the alphabet, where is the result of the operation performed in the previous step.
- Repeat steps and , moving to the next block each time until all blocks have been decrypted.
For example, if the encrypted message is
43125223 and the code book is
42104919, the blocks for the encrypted message would be
43 12 52 23 and the blocks for the code book would be
42 10 49 19.
, therefore the first letter is
, therefore the second letter is
, therefore the third letter is
, therefore the fourth letter is
The message therefore would be
The input consists of lines.
The first line will be the code book, (), the length of which is even.
The second line will be the encrypted message, ()
It is guaranteed that the decrypted message will be a string consisting of alphabet letters.
The output will consist of one line of uppercase letters, the decrypted message.