object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN, datL) = readLine.split(" ").map(_.toInt)
    val datS = for(i <- 1 to datN) yield (readLine.split(" ").head)

    val ans = datS.sorted.mkString
    println(ans)
  }
}
