main@m=getLine>>=putStrLn.r>>m r[s]=[s];r(s:t)=last t:init t++[s]