def f(): a=l() if"if"==a:a=f();l();a=[f()+l()*0,f()][a<"t"] return a while 1:l=input().split()[::-1].pop;print(f())