#include using namespace std; #define ll long long #define endl "\n" #define rep(i, a, n) for (int i = a; i < n; ++i) int main() { ios::sync_with_stdio(false); cin.tie(0); int h, n; cin >> h >> n; vector hi(n - 1); rep(i, 0, n - 1) cin >> hi[i]; sort(hi.begin(), hi.end()); reverse(hi.begin(), hi.end()); if (hi[0] < h) { cout << "1st" << endl; return 0; } else if (hi[1] < h) { cout << "2nd" << endl; return 0; } else if (hi[2] < h) { cout << "3rd" << endl; return 0; } else { rep(i, 3, n - 1) { if (hi[i] < h) { cout << i << "th" << endl; return 0; } } } cout << n << "th" << endl; return 0; }