/**
  * Created by kohei on 16/08/05.
  */
object B extends App{
  import scala._
  val l1 = io.StdIn.readLine()
  val N = l1.split(" ")(0).toInt
  val L = l1.split(" ")(1).toInt

  val words = (0 until L).map((i) => {
    io.StdIn.readLine()
  })

  println(words.sorted.mkString(""))
}