def ordinal(n): suffix = ['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th'] m = n % 10 return str(n) + suffix[m] h, n = map(int, input().split()) c = 0 for _ in range(n-1): hi = int(input()) if hi > h: c += 1 print(ordinal(c+1))