Emma planned to buy a string S consisting of lowercase English characters of size N as a gift for her friend Ava on her birthday. Ava had Q other friends who also wanted to contribute but were not happy with the string. So all Q of her friends decide to do either of the two operations :
All of this was too much for Emma to handle alone. So she asked you to help her find the final string after doing all the operations.
Note : Assume 0-based indexing.
Input Format:
Output Format:
For each test case, print a string of size N denoting the final string.
Constraints:
1≤T≤5
1≤N,Q≤105
S contains all lower case English alphabets.
0≤X<N
In the first test case, after the first operation, the string becomes aucbb as we are reversing from 1st index to 3rd index. After the second operation, the string becomes audbb as we are changing c to d at the 2nd index and after the third operation string becomes bbdua, as we are reversing the string from index 0 to 4.
In the second test case, after the first operation string becomes codjng as we are changing the i to j at index 3 and after the second operation string becomes cojdng as we are reversing the string from index 2 to 3.