Special array reversal
Submissions: 4538   Accuracy:

30.74%

  Difficulty: Easy   Marks: 2

Given a string S, containing special characters and all the alphabets, reverse the string without
affecting the positions of the special characters.

 

Input
The first line of input contains an integer T denoting the number of test cases. Then T test cases
follow. 
The first line of each test case contains a case-insensitive string S.


Output
Print out the reversed string without  affecting special characters.


Constraints
1 <= T <= 100
0 <   S  <= 100

 

Examples 

Input
3
A&B
abc%sld*
dakA&*hA@#N

Output
B&A
dls%cba*
NAhA&*ka@#d

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: Rohan Malhotra


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.