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 = [None, "st", "nd", "rd"] + ["th"] * (n - 3) print(ans, end[ans], sep="")