#include using namespace std; int main() { int h, n; cin >> h >> n; vector as(n - 1); for (auto &&a : as) { cin >> a; } as.emplace_back(h); sort(as.rbegin(), as.rend()); for (int i = 0; i < n; i++) { if (as[i] == h) { cout << i + 1; if ((i + 1) % 10 == 1) { cout << "st"; } else if ((i + 1) % 10 == 2) { cout << "nd"; } else if ((i + 1) % 10 == 3) { cout << "rd"; } else { cout << "th"; } cout << endl; } } return 0; }