#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()); for (int i = 0; i < N; i++) { if (H[i] != h) continue; 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; break; } }