H, N = map(int, input().split()) from bisect import bisect h = [int(input()) for i in range(N - 1)] h.sort() ans = N - bisect(h, H) if ans % 10 == 1: print(ans, 'st', sep='') elif ans % 10 == 2: print(ans, 'nd', sep='') elif ans % 10 == 3: print(ans, 'rd', sep='') else: print(ans, 'th', sep='')