ONP  Transform the Expression
Transform the algebraic expression with brackets into RPN form (Reverse Polish Notation). Twoargument operators: +, , *, /, ^ (priority from the lowest to the highest), brackets ( ). Operands: only letters: a,b,...,z. Assume that there is only one RPN form (no expressions like a*b*c).
Input
t [the number of expressions <= 100] expression [length <= 400] [other expressions]
Text grouped in [ ] does not appear in the input file.
Output
The expressions in RPN form, one per line.
Example
Input: 3 (a+(b*c)) ((a+b)*(z+x)) ((a+t)*((b+(a+c))^(c+d))) Output: abc*+ ab+zx+* at+bac++cd+^*
hide comments
mohanteja1:
20190216 12:37:43
solved this with recursion 

lnediak:
20190127 21:01:15
lol I did rly stupid i didn't use stack i created dumb token class and separate on operator but it works anyways i think maybe logn times slower than stack 

traitorakali:
20190108 07:16:03
Why I keep geting runtime error (NZEC) ? 

karankeswani99:
20190107 18:58:28
Just use stack


rajulrs13:
20181230 22:10:19
got me stuck for an hour because I took expression length to be 100.. : ( 

dhuruvapriyan:
20181224 15:46:52
Last edit: 20181224 15:47:23 

sehgal_divij:
20181223 13:12:22
Why would my code take 16M Memory to execute?


cypher33:
20181219 12:21:17
Got it 

surya_55:
20181204 10:43:11
solved by using just stack in one go...! 

Ritwik:
20181204 08:18:08
There is a problem in test cases. My solution is AC in first attempt but later I found out it gives wrong output in those testcases which are without brackets. For example: "a*b+c" 
Added by:  mima 
Date:  20040501 
Time limit:  5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL6 VB.NET 
Resource:   