-- ABC042 B - 文字列大好きいろはちゃんイージー / Iroha Loves Strings (ABC Edition)

import Data.List
import Control.Monad

main ::IO()
main = do
    [n,len] <- map read . words <$> getLine
    sls <- replicateM n getLine
    putStrLn $ ketugou $ sort sls


ketugou :: [String] -> String
ketugou [] = ""
ketugou strls = head strls ++ ketugou (tail strls)


