import java.util.Scanner var input = Scanner(System. `in`) fun heightList(nama: Int, testCase: Int): MutableList{ var list: MutableList = mutableListOf(nama) for(i in 1..testCase - 1) list.add( input.nextInt() ) return list } fun result(list: MutableList, nama: Int){ list.sortBy{ it * -1} var ele = Integer.parseInt( (list.indexOf(nama).toString().split(""))[1] ) if(ele == 0) println("${ele + 1}st") else if(ele == 1) println("${ele + 1}nd") else if(ele == 2) println("${ele + 1}rd") else println("${ele + 1}th") } fun main(args: Array){ var nama: Int = input.nextInt() var testCase: Int = input.nextInt() var list: MutableList = heightList(nama, testCase) result(list, nama) }