import Control.Monad import Data.List rInt :: String -> Int rInt = read func079 [] = [] func079 xs = (x, c) : func079 xs' where x = head xs c = length $ filter (== x) xs xs' = drop c xs sortSnd x y | snd x > snd y = LT | otherwise = GT main = do n <- getLine ls <- sort . map rInt . words <$> getLine let ls' = sortBy sortSnd $ func079 ls print ls'