import Control.Monad import Data.List import Data.Ord main = do [a,b,c] <- (replicateM 3 readLn) :: IO [Int] let l = reverse $ sortBy (comparing snd) [("A",a),("B",b),("C",c)] putStrLn . fst $ head l putStrLn . fst . head $ drop 1 l putStrLn . fst $ last l