import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  [n,l] <- getl $ wrds toInt
  solve <$> replicateM n getLine >>= putStrLn

solve :: [String] -> String
solve = concat . sort

toInt :: String -> Int
toInt = read

wrds :: (String -> a) -> String -> [a]
wrds f = map f . words

getl :: (String -> a) -> IO a
getl f = f <$> getLine
