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