l = []
o = ["+", "-", "*"]
for i in input().split():
  if i in o:
    t = eval("{0}{1}{2}".format(l[-2], i, l[-1]))
    l.pop(-1)
    l[-1] = t
  else: l += [int(i)]
print(*l) l = [] l [] o = ["+", "-", "*"] o ["+", "-", "*"] "+" "-" "*" for i in input().split():
  if i in o:
    t = eval("{0}{1}{2}".format(l[-2], i, l[-1]))
    l.pop(-1)
    l[-1] = t
  else: l += [int(i)] i input().split() ().split () input split if i in o:
    t = eval("{0}{1}{2}".format(l[-2], i, l[-1]))
    l.pop(-1)
    l[-1] = t
  else: l += [int(i)] i in o i o t = eval("{0}{1}{2}".format(l[-2], i, l[-1])) t eval("{0}{1}{2}".format(l[-2], i, l[-1])) eval "{0}{1}{2}".format(l[-2], i, l[-1]) "{0}{1}{2}".format "{0}{1}{2}" format l[-2] l -2 i l[-1] l -1 l.pop(-1) l.pop l pop -1 l[-1] = t l[-1] l -1 t print(*l) print *l l o = ["+", "-", "*"] ["+", "-", "*"] o l = [] [] l t = eval("{0}{1}{2}".format(l[-2], i, l[-1])) eval("{0}{1}{2}".format(l[-2], i, l[-1])) t
l = []
o = ["+", "-", "*"]
for i in input().split():
  if i in o:
    t = eval("{0}{1}{2}".format(l[-2], i, l[-1]))
    l.pop(-1)
    l[-1] = t
  else: l += [int(i)]
print(*l)
