import Control.Monad import Data.Either import Control.Applicative import Control.Arrow if_::Bool->a->a->a if_ =(.(.return).(++).return).(.).(flip (!!)).(1-).fromEnum test=((<*>Right).).(.(flip if_.Left)).flip (.) list1=[('<','>'),('>','<')] change =((either id head.sequence).).(.(flip id)).flip fmap.((test.fst<*>snd) <$>first (==)<$>) main = getLine>>=(putStrLn.reverse.fmap (change list1))