#include #include #include using namespace std; int main() { // input int H, N; cin >> H >> N; vector h(N); for (int i = 0; i < N; ++i) { cin >> h[i]; } // solve & output sort(h.begin(), h.end()); if (h[N - 1] < H) { cout << "1st" << endl; return 0; } else if (h[N - 2] < H) { cout << "2nd" << endl; return 0; } else if (h[N - 3] < H) { cout << "3rd" << endl; return 0; } else { for (int i = N - 4; i >= 0; --i) { if (h[i] < H) { cout << N - i << "th" << endl; break; } } } return 0; }