main=getLine>>=interact.f f('e':_)(a:b:x)=a:f"e"x++[b] f _(a:x)=a:f""(reverse x) f _ x=x