#P7744. [2019年杭电多校]Rikka with Game
[2019年杭电多校]Rikka with Game
Rikka with Game
Problem Description
Though both Rikka and Yuta are busy with study, on their common leisure, they always spend time with each other and sometimes play some interesting games. Today, the rule of the game is quite simple. Given a string with only lowercase letters. Rikka and Yuta need to operate the string in turns while the first operation is taken by Rikka. In each turn, the player has two choices: The first one is to terminate the game, and the second one is to select an index of and right shift the value of char , i.e., $a \rightarrow b, b \rightarrow c, \dots, y \rightarrow z, z \rightarrow a$. If the game is still alive after turns, i.e., after Yuta finishes his turns, the game will end automatically. The final result is the value of when the game is over. Now, Rikka wants to minimize the lexicographical order of the result while Yuta wants to maximize it. You are required to calculate the result of the game if both Rikka and Yuta play optimally. For two string and with equal length , is lexicographically smaller than if and only if there exists an index which satisfies and holds for all .
Input
The first line of the input contains an integer , the number of test cases. For each test case, the input contains a single line with a single string with only lowercase letters, the initial value of .
Output
For each test case, output a single line with a single string, the answer.
Sample Input
2
a
zbc
Sample Output
a
bbc
Source
2019 Multi-University Training Contest 9