BYU15W_1 - Decrypt the Message

You have been tasked to create a program to decrypt a simple encrypted message. The steps to encrypt messages in this format are to:

  1. Reverse the message content
  2. Move every third (3rd, 6th, 9th...) character to the end of the message (sequentially)
  3. Change each letter to the next letter of the alphabet (a → b, b → c ... z → a)

For example, by following the steps above the message "abbcdd" is encrypted as follows:

  1. ddcbba
  2. ddbbca
  3. eeccdb

Your program must decrypt the given encrypted messages.

Input

The first line contains a single positive integer N. The next N lines each contain a single message composed of lowercase alphabetic characters (a-z).

Output

For each of the N lines, output the decrypted message as a string of lowercase alphabetic characters.

Example

Input:
2
eeccdb
uijsjuhvztpjbmubhodhuppouvsp

Output
abbcdd
congratulationsyougotitright

Added by:BYU Admin
Date:2015-03-28
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2015-03-29 12:56:41 Mitch Schwartz
Moved this problem to tutorial along with BYU15W_3 and BYU15W_5 for being very simple.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.