s=[];x=s.pop while 1: for c in raw_input()[::-2]:s+=c*c.isdigit()or[x()+' '+x()+' '+c] print x()