import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] h = new int[100]; int n = 2; int tmp; for(int i = 0; i < n; i++){ h[i] = sc.nextInt(); if(i == 0){ n = sc.nextInt(); } } int mr = h[0]; for(int j = 0; j < n; j++){ for(int k = j; k < n; k++){ if(h[k] < h[j]){ tmp = h[k]; h[k] = h[j]; h[j] = tmp; } } } int o = 0; for(int l = 0; l < n; l++){ if(h[l] == mr){ o = l; break; } } int num = n - o; if(num == 1){ System.out.println(num + "st"); }else if(num == 2){ System.out.println(num + "nd"); }else if(num == 3){ System.out.println(num + "rd"); }else{ System.out.println(num + "th"); } } }