import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collections; public class No00000564_Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { String[] hn = br.readLine().split(" "); int h = Integer.parseInt(hn[0]); int n = Integer.parseInt(hn[1]); Integer[] l = new Integer[n-1]; for(int i = 0;i < n - 1; i++) { l[i] = Integer.parseInt(br.readLine()); } Arrays.sort(l, Collections.reverseOrder()); for(int j = 0; j < n - 1; j++) { if(l[j] < h) { if(j % 10 == 0) System.out.println((j + 1) + "st"); if(j % 10 == 1) System.out.println((j + 1) + "nd"); if(j % 10 == 2) System.out.println((j + 1) + "rd"); if(j % 10 > 2) System.out.println((j + 1) + "th"); return; } } System.out.println(n + "th"); } }