def get_rank(students_height, nama_height): rank = 1 students_height.sort(reverse=True); for e in students_height: if nama_height > e: return rank else: rank = rank + 1 return rank def get_last_digit(num): return num % 10 line1 = [int(i) for i in input().split()] nama_height = int(line1[0]) students_num = int(line1[1]) students_height = [] for i in range(students_num - 1): students_height.append(int(input())) rank = get_rank(students_height, nama_height) last_digit = get_last_digit(rank) if last_digit == 1: print (str(rank) + "st") elif last_digit == 2: print (str(rank) + "nd") elif last_digit == 3: print (str(rank) + "rd") else: print (str(rank) + "th")