package beginner_042

import java.text.Collator
import scala.io.StdIn.readLine

object MainB {
  def main(args: Array[String]): Unit = {
    val n = readToListInts.head
    println(
      solve(
        (0 until n).map(_ => readLine).toList
      )
    )

  }

  def solve(list: List[String]): String = {
    val k = Collator.getInstance()
    list.sortWith((s1, s2) => k.compare(s1, s2) < 0).mkString
  }

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