fun main(args : Array) { val hnLst = (readLine() ?: "").run { split(" ") }.map { it.toInt() } val hLst = (1..(hnLst[1] - 1)).map { readLine() ?: "" }.map { it.toInt() } hLst.filter { it > hnLst[0] } .count() .let { it + 1 } .let { when (it % 10) { 1 -> "${it}st" 2 -> "${it}nd" 3 -> "${it}rd" else -> "${it}th" } } .let { println(it) } }