fun main(args: Array<String>) {
    val (N,L) = readLine()!!.split(" ").map(String::toInt)
    var list: MutableList<String> = mutableListOf()
    for (i in 1..N) {
        list.add(readLine()!!)
    }
    for(l in list.sorted()) {
        print(l)
    }
}