#include "bits/stdc++.h" using namespace std; using ll = long long; using IP = pair; #define INF 999999999 #define atcoder(int)1e9+7 int main() { int H, N; int cnt = 1; cin >> H >> N; for (int i = 0; i < N -1; i++) { int a; cin >> a; if (H < a)cnt++; } if (cnt == 1)cout << cnt << "st" << endl; else if (cnt == 2)cout << cnt << "nd" << endl; else if (cnt == 3)cout << cnt << "rd" << endl; else cout << cnt << "th" << endl; return 0; }