import java.util.*

fun main(args: Array<String>) {
    Scanner(System.`in`).use {
        val n = it.nextInt()
        val L = it.nextInt()
        val list = mutableListOf<String>()
        for (i in 0 until n) {
            list.add(it.next())
        }
        list.sort()
        val r: String = list.joinToString("")
        println(r)
    }
}
