#include using namespace std; int H, n, h[102]; int main() { cin >> H >> n; h[0] = H; for (int i = 0; i < n - 1; ++i) { cin >> h[i + 1]; } sort(h, h + n, greater()); for (int i = 0; i < n; ++i) { if (h[i] == H) { if (i == 0) { cout << "1st" << endl; } else if (i == 1) { cout << "2nd" << endl; } else if (i == 2) { cout << "3rd" << endl; } else { cout << i + 1 << "th" << endl; } return 0; } } return 0; }