import java.util.Scanner

object Main {
  val sc = new Scanner(System.in)
  def main(args: Array[String]): Unit = {
    val n  = sc.nextInt
    val l  = sc.nextInt
    val sl = List.fill(n)(sc.next)

    val res = sl.sorted.foldLeft("")(_ + _)

    println(res)
  }
}
