import Control.Applicative
import Control.Monad
import Data.List
import Data.Ratio
import Text.Printf
import System.IO

untilEOF :: IO () -> IO ()
untilEOF x = do
  e <- isEOF
  unless e $ x >> untilEOF x

main :: IO ()
main = untilEOF $ do
  str <- getLine
  putStrLn $ reverse str

