import Control.Applicative ((<$>)) import Control.Monad import Data.List import Data.Function (on) main :: IO () main = do solve <$> replicateM 3 (read <$> getLine) >>= mapM_ putStrLn solve :: [Int] -> [String] solve xs = f xs where f = map fst . sortBy (flip compare `on` snd) . zip ["A", "B", "C"]