There was an ancient encryption method called ‘Vigenère cipher’. The one who wants to read a message encrypted need a secret word, the key to the plaintext. The encryption method is shown below. Your task is to write a program that can decode a set of characters into a valid string. Of course, keys are given.
Let A=0, B=1, C=2 … Z=25, add operation of two character is to convert each of them into numbers. The sum of two characters is the sum of two numbers modulo 26 and converts it back to character.
Ex: T=19 S=18
T+S = 19+18(mod 26) = 11 = L
Vigenère cipher involves adding the plaintext to a letter of duplicated key. For Example,
Plaintext: this is a test message
Key: sesame
There are several test cases.
The first line of each case is a string, key. All keys are in capital alphabet set ‘A’ – ‘Z’.
The second line to the end of each test case is cipher-text you should decode.
Each test case is separated by a single ‘#’ symbol in a line.
You have to do nothing to the words without capital alphabet set ‘A’ – ‘Z’, in another words, ignore those symbol not in the set.
For each test, output several lines of plaintext. Each case is separated by a blank line.