import strutils, sequtils, algorithm let HN = readLine(stdin).split.map parseInt var arr = newSeqWith(0, 0) for i in 0 ..< (HN[1] - 1): arr.add readLine(stdin).parseInt arr.sort(cmp, Descending) var i = 0 while not(i > arr.high or HN[0] > arr[i]): i += 1 echo i + 1, ["st", "nd", "rd", "th"][min(3, i)]