main :: IO ()
main = do
  nl <- words <$> getLine
  let n = read $ head nl
  ss <- getStrs n
  putStr $ concat $ qsort ss 

getStrs :: Int -> IO [String]
getStrs n = sequenceA(replicate n getLine)

qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x:xs) = (qsort (filter (<=x) xs)) ++ [x] ++ (qsort (filter (>x) xs))
