Part 5 of 17 in Stacks & Queues  

Reverse a string by admin

Problem statement

Given a string, print the reverse of it.

Input

First line will contain an integer T = Number of test cases. Next n lines will contain one word each of not more than 50 characters

Output

Print one word for each input on a seperate line which is reverse of the input word.

Sample Input
3
aab
aaa
bab
Sample Output
baa
aaa
bab
1) The number of characters can either be even or odd. Are you good for both kind of test cases.


To try out your code



Sign in

Sign up