import bisect h,n=map(int,input().split()) s=sorted(int(input()) for _ in range(n-1)) t=str(len(s)-bisect.bisect_right(s,h)+1) if t[-1]=='1': print(t+'st') elif t[-1]=='2': print(t+'nd') elif t[-1]=='3': print(t+'rd') else: print(t+'th')