Hidden Password
시간 제한3초메모리 제한1024 MB
한 비밀번호가 주어질 때, 각각을 d만큼 카이사르 이동했을 때 서로 바뀌는 다른 비밀번호를 구하고, 유일하지 않으면 NIE를 출력한다.
문제
After a successful internship, Bytholomew was hired as a senior cyber-security expert. To lead by example, he decided to finally heed his own advice and use two different passwords for his e-mail and for the Facepalm social media. Unfortunately, remembering two passwords proved too much for him. Moreover, he couldn't just plainly write the passwords somewhere, as it would be against another of his recommendations. But being a security expert, Bytholomew knew exactly what to do. He chose his favorite integer and wrote both passwords encoded with Caesar cipher with key .
Pleased with his work, he looked at his notes and the horrible truth dawned on him: after the encoding, the first (e-mail) password became literally the second (Facepalm) password, while the second one turned into the first one. ,,Holy moly!" -- Bytholomew exclaimed, as there was nothing more to say.
Now you too can become a security expert -- knowing the first of Bytholomew's passwords, guess the second one, if possible.
입력
The first line of input contains the number of test cases (). The descriptions of the test cases follow.
Each test case is one word -- the password -- consisting of lowercase English letters, in a separate line. The password has at least character and at most characters.
The total number of characters in all passwords does not exceed .
출력
For every given password, guess and output the second one in a separate line. If the second password cannot be determined (either because there is no solution or because there is more than one), output a single word NIE instead.
힌트
The Caesar cipher means substituting each letter with the one places down the alphabet, treating alphabet as cyclic if necessary. E.g. for the letter a is substituted by d, b by e,...., w changes into z, x to a, y to b and z to c.