from bisect import bisect_left h, n = map(int, input().split()) hs = [int(input()) for _ in range(n - 1)] hs.sort() i = bisect_left(hs, h) ans = n - i end = ["th", "st", "nd", "rd"] + ["th"] * 6 print(ans, end[ans % 10], sep="")