String practice 3
In ancient Rome, the military uses an encryption system to scramble their message so that it's not readable by their enemies.
The principle is very simple, for every letter in the message, the Roman officer would replace it with the \(X\)th letter after it in the alphabet.
For example, if \(X\) is 3, then A
becomes D
, B
becomes E
,
Z
becomes C
. Given original text:
I LIKE CHEESE
The encrypted text for \(X=1\) should be:
J MJLF DIFFTF
Your task is given \(X\) and an encrypted text, recover it's original content.
Input Specification
The first line will contain 2 integers \(N\) (\(1 < N < 200\)), indicating the number of test cases, and \(X\) (\(-200 < X < 200\)), the encryption key.
The following \(N\) lines will each contain a string with maximum length 200. It is guaranteed that there will only be uppercase letters in the test cases.
Output Specification
The output should contain \(N\) lines, each line a string, with the decrypted message.
Sample Input
4 27
J
MJLF
DIFFTF
J MJLF DIFFTF
Sample Output
I
LIKE
CHEESE
I LIKE CHEESE
Comments