import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int nama = in.nextInt(); int n = in.nextInt(); int[] h = new int[n-1]; for(int i=0; i=0; i--) { if(nama < h[i]) { continue; } else if(i == n-2 && nama > h[i]) { pos = 1; break; } else { pos = n - i - 1; break; } } /* switch(pos%10) { case 1: System.out.println(pos + "st"); break; case 2: System.out.println(pos + "nd"); break; case 3: System.out.println(pos + "rd"); break; default: System.out.println(pos + "th"); break; } */ if(pos % 10 == 1) System.out.println(pos + "st"); else if(pos % 10 == 2) System.out.println(pos + "nd"); else if(pos % 10 == 3) System.out.println(pos + "rd"); else System.out.println(pos + "th"); } }