#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; int N = n-1; rep(i, N) { int t; cin >> t; if (t != h) { a.push_back(t); } else { n--; } } a.push_back(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; }