object Main extends App {

  import scala.io.StdIn.readLine
  val Array(n, l) = readLine().trim.split(" ").map(_.toInt)
  var arr = Array.fill(n)("")
  for (i <- 0 until n) {
    arr(i) = readLine().trim
  }
  println(arr.toList.sorted.mkString)

}
