package beginner_042

import scala.io.StdIn.readLine

object Main {
  def main(args: Array[String]): Unit = {
    val List(n, l) = readToListInts

    println(
      solve(
        {
          for {
            _ <- 0 until n
          } yield readLine
          }.toList
      )
    )

  }

  def solve(list: List[String]): String = list.sortWith((s1, s2) => s1 < s2).mkString

  def readToListInts: List[Int] = readLine.split(" ").map(_.toInt).toList
}