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