Reversing the equation
Easy Accuracy: 42.01% Submissions: 788 Points: 2

Given a mathematical equation using numbers/variables and +, -, *, /. Print the equation in reverse.

Input:
The first line consists of an integer T i.e number of test cases. The first line and only line of each test case consists of an string s.

Output:
Print the string in reverse.

Constraints: 
1<=T<=100
1<=|Length of String|<=100

Example:
Input:

2
20-3+5*2
a+b*c-d/e

Output:
2*5+3-20
e/d-c*b+a

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.