import java.io.*; import java.util.*; public class Main_yukicoder564 { private static Scanner sc; private static Printer pr; private static void solve() { int h = sc.nextInt(); int n = sc.nextInt(); int[] hh = new int[n - 1]; int cnt = 1; for (int i = 0; i < n - 1; i++) { hh[i] = sc.nextInt(); if (hh[i] > h) { cnt++; } } if (cnt % 10 == 1) { pr.printf("%dst\n", cnt); } else if (cnt % 10 == 2) { pr.printf("%dnd\n", cnt); } else if (cnt % 10 == 3) { pr.printf("%drd\n", cnt); } else { pr.printf("%dth\n", cnt); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }