#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 << i + 1 << "st" << endl; } else if (i == 1) { cout << i + 1 << "nd" << endl; } else if (i == 2) { cout << i + 1 << "rd" << endl; } else { cout << i + 1 << "th" << endl; } } } return 0; }