Reverse The Number Problem Code: FLOW007 (CodeChef)

Given an Integer N, write a program to reverse it.

Input

The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer N.

Output

For each test case, display the reverse of the given number N, in a new line.

Constraints

  •  T  1000
  •  N  1000000

Example

Input
4
12345
31203
2123
2300
Output
54321
30213
3212
32
Solution
t=int(input())
for i in range(t):
    s=input()
    print(int(s[::-1]))

Comments

Popular posts from this blog

Sort in specific order (GFG)

Chef and Remissness Problem Code: REMISS (CodeChef)

Short Notes Of computer Network