#include using namespace std; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { int h, N; cin >> h >> N; vector H(N); for (int i = 0; i < N; i++) { cin >> H[i]; } H.push_back(h); N++; sort(H.begin(), H.end(), greater()); for (int i = 0; i < N; i++) { if (H[i] != h) continue; if (i % 10 == 0) cout << i + 1 << "st" << endl; else if (i % 10 == 1) cout << i + 1 << "2nd" << endl; else if (i % 10 == 2) cout << i + 1 << "3rd" << endl; else cout << i + 1 << "th" << endl; break; } }