{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} import Control.Applicative import Control.Monad import Control.Arrow import Data.List import Data.Maybe import Data.Char import qualified Data.ByteString.Char8 as B import Text.Printf import Data.Ord readInt = ( readLn :: IO Int ) readInts = map ( read :: String -> Int ) . words <$> getLine getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine which a b f = if f then a else b mp [ a, b ] = ( a, b ) main = do ps <- replicateM 3 $ mp <$> readInts mapM_ ( printf "%c\n" ) $ map snd $ reverse $ sortBy comp $ zip ps [ 'A' .. ] comp ( ( h1, w1 ), _ ) ( ( h2, w2 ), _ ) | h1 /= h2 = compare h1 h2 | w1 /= w2 = compare w2 w1 | otherwise = EQ