#include #define rep(i, n) for (int i = 0; i < n; ++i) using ll = long long; using namespace std; const int INF = 1e9; int main() { int h, n; cin >> h >> n; vector H(n), sor(n); rep(i, n - 1) cin >> H[i]; H[n - 1] = h; sor = H; rep(i, n) sor[i] = -sor[i]; sort(sor.begin(), sor.end()); int ans = lower_bound(sor.begin(), sor.end(), -h) - sor.begin() + 1; cout << ans; if (ans % 10 == 1) cout << "st"; else if (ans % 10 == 2) cout << "nd"; else if (ans % 10 == 3) cout << "rd"; else cout << "th"; cout << endl; return 0; }