#include #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; typedef vector> mat; const int INF = 1e9; int H, N; int Hi[1010]; signed main() { cin >> H >> N; int ans = 1; REP(i,N-1) { cin >> Hi[i]; if (H < Hi[i]) ans++; } if (ans == 1) { cout << "1st" << endl; } else if (ans == 2) { cout << "2nd" << endl; } else if (ans == 3) { cout << "3rd" << endl; } else { cout << ans << "th" << endl; } }