{-# LANGUAGE OverloadedStrings #-}

import Data.List
import qualified Data.ByteString.Char8 as B
import Control.Monad

main = breads >>= flip replicateM B.getLine . head >>= mapM_ B.putStr . sort >> B.putStrLn ""

breads :: IO [Int]
breads = unfoldr uff <$> B.getLine
    where
        uff b = check <$> B.readInt b
        check (a, b)
            | B.null b = (a, b)
            | otherwise = (a, B.tail b)
