h, N = map(int, input().split()) H = [int(input()) for i in range(N - 1)] from bisect import bisect x = N - bisect(sorted(H), h) if str(x)[-1] == "1": print(str(x) + "st") elif str(x)[-1] == "2": print(str(x) + "nd") elif str(x)[-1] == "3": print(str(x) + "rd") else: print(str(x) + "th")