import qualified Data.List as DL
import Control.Monad
solve :: [String] -> String
solve ss = join $ DL.sort ss

main = do [n, l] <- map read . words <$> getLine
          ss <- replicateM n getLine
          putStrLn $ solve ss
