fun main(args: Array<String>) {
    val  inLyric = readLine()?.split(" ").orEmpty()
    val amountN = inLyric[0].toInt()
    val lengthL = inLyric[1].toInt()
    var inList = mutableListOf<String>()
    var i = 0

    while(i < amountN){
        inList.add(readLine().orEmpty())
        i++
    }

    inList.sort()
    inList.forEach{
        print(it)
    }

}