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