import strutils, sequtils, algorithm let HN = readLine(stdin).split.map parseInt var arr = newSeqWith(0, 0) for i in 2 .. HN[1]: arr.add readLine(stdin).parseInt arr.sort(cmp, Descending) var i = 0 while i < arr.len and HN[0] <= arr[i]: i += 1 echo i + 1, ["st", "nd", "rd", "th"][min(i.repr[^1].int, 3)]