b=[] a=[int(i) for i in input().split()] for i in range(a[1]-1): b.append(int(input())) b.append(a[0]) b.sort() for i,j in enumerate(b): if j==a[0]: if len(b)-i==1: print("1st") elif len(b)-i==2: print("2nd") elif len(b)-i==3: print("3rd") else: s=len(b)-i print(str(s)+"th")