s=[]
p=s.pop
for e in input().split():
 s+=[e if e.isdigit() else str(eval(p(-2)+e+p()))]
print(*s) s=[] s [] p=s.pop p s.pop s pop for e in input().split():
 s+=[e if e.isdigit() else str(eval(p(-2)+e+p()))] e input().split() ().split () input split s+=[e if e.isdigit() else str(eval(p(-2)+e+p()))] s [e if e.isdigit() else str(eval(p(-2)+e+p()))] e if e.isdigit() else str(eval(p(-2)+e+p())) e.isdigit() e.isdigit e isdigit e str(eval(p(-2)+e+p())) str eval(p(-2)+e+p()) eval p(-2)+e+p() p(-2)+e p(-2) p -2 e p() p print(*s) print *s s p=s.pop s.pop p s=[] [] s s+=[e if e.isdigit() else str(eval(p(-2)+e+p()))] [e if e.isdigit() else str(eval(p(-2)+e+p()))] s
s=[]
p=s.pop
for e in input().split():
 s+=[e if e.isdigit() else str(eval(p(-2)+e+p()))]
print(*s)