TIME LIMIT = 1 SEC.
- All the digital communication around is encrypted for security. Encryption is necessary as privacy is a human right. In college, you are in charge of encrypting sensitive messages.
The rule for encryption is as follows: If the given word is a palindrome, then perform left shift operation once on that word. If the given word is not a palindrome, then perform right shift twice on that word.
NOTE: Left shift indicates that each character is shifted to the left i.e. C becomes B, B becomes A and A becomes Z and so on.Right shift indicates that each character is shifted to the right i.e. A becomes B, B becomes C and Z becomes A and so on.
|First line will contain N, number of words.
Each of the next N lines contains one word (in lowercase), whose length does not exceed 50.
|Print the corresponding shifted word for each of the given words according to the rule above.|
- 1 ≤ N ≤ 200