import java.util.*;

public class Main{
  static StringBuilder sb = new StringBuilder("");
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int H1 =sc.nextInt();
    int N =sc.nextInt();
    int n = (N-1);
    int[] H = new int[N];
    for (int i=0;i<n ;i++ ) {
      H[i] = sc.nextInt();
    }
    Arrays.sort(H);
    if (H1>H[0]) {
      System.out.println("1st");
    }else if(H1>H[1]){
      System.out.println("2nd");
    }else if (H1>H[2]) {
      System.out.println("3rd");
    }else{
      System.out.println("4th");
    }
  }
}