// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input int H, N; cin >> H >> N; vector h(N - 1); rep(i, N - 1) cin >> h[i]; // Output sort(h.begin(), h.end()); int rank = N - (lower_bound(h.begin(), h.end(), H) - h.begin()); cout << rank; if (rank % 10 == 1) cout << "st\n"; else if (rank % 10 == 2) cout << "nd\n"; else if (rank % 10 == 3) cout << "rd\n"; else cout << "th\n"; }