import List;main=getLine>>=mapM putStrLn.filter(/="").concatMap inits.reverse.tails