import Data.List import Data.Char main = interact $ foldl1 (++) . map show . reverse . sort . map (read :: String -> Int) . map (\c -> show $ digitToInt c)