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
karthik_spoj1:
20201004 15:27:49
maintaining two stacks makes it easier


appuk:
20200910 17:14:10
im gettung a runtime error when submitting? can anyone help??


jjprioli:
20200806 06:26:14
This one WAS stupideasy, though I will admit I started to overthink it. (Hallmark of a good contest problem!)


thetwinzycats_:
20200805 10:02:18
lolololo 

hemanth_ds:
20200804 11:32:21
suggestion:Don't think deep,its doable!


anurag_pandey_:
20200729 04:39:32
May Anyone explain this problem?


zerothking:
20200724 14:33:56
I solved it pretty easily using stacks by how can i solve it without stack? (Some people have said they have used recursion and some have used ifelse blocks) 

paritosh99:
20200723 10:31:54
New to CP still AC in first attempt 

khasrulalam:
20200612 06:20:16
no need deep thinking 

hello_1234:
20200604 15:14:59
can anyone one explain this problem!! 
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:   