main=f"" f x=do y<-getLine;putStrLn$x#y;f$x#y (a:x)#(b:y)=last(b:[a|b<'!']):x#y x#y=x++y