import java.util.*

fun main(args : Array<String>) {
    val scanner = Scanner(System.`in`)
    println(inOutExec(scanner))
}

fun inOutExec(scanner: Scanner): String {
    val num = scanner.nextInt()
    scanner.nextInt()

    val strList = mutableListOf<String>()
    repeat(num) {
        strList.add(scanner.next())
    }
    strList.sort()
    return strList.joinToString(separator = "")
}