fun main(args: Array<String>){
    val (a, b) = readLine()!!.split(" ").map{it.toInt()}
    var r = mutableListOf<String>()

    for(i in 0 until a){
        r.add(readLine()!!)
    }
    r.sort()
    val str = r.joinToString(separator = "")
    println(str)
}
