import Control.Monad (replicateM) import Data.List (sortOn) main = replicateM 3 readLn >>= mapM putStrLn . solve solve :: [Int] -> [String] solve ns = reverse $ snd $ unzip $ sortOn fst $ zip ns ["A", "B", "C"]