import io.{StdIn => in}

object Main extends App {
  val Array(n, len) = in.readLine.split(" ").map(_.toInt)
  val ans = Iterator.continually(in.readLine)
    .take(n)
    .toArray
    .sorted
    .reduce(_ + _)

  println(ans)
}