import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List list = new ArrayList<>(); int h0 = sc.nextInt(); list.add(h0); int n = sc.nextInt(); for(int i = 0; i < n-1; i++) { int tmp = sc.nextInt(); list.add(tmp); } Collections.sort(list); Collections.reverse(list); for(int i = 0; i < n; i++) { if(h0 == list.get(i)) { display(i+1); break; } } } static void display(int index) { StringBuilder sb = new StringBuilder(); sb.append(index); int redi = index%10; if(redi == 1) { sb.append("st"); } else if(redi == 2) { sb.append("nd"); } else if(redi == 3) { sb.append("rd"); } else { sb.append("th"); } System.out.println(sb.toString()); } }