#include using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int nama, N; cin >> nama >> N; int rank = 1; REP(i, N - 1) { int h; cin >> h; if (h > nama) rank++; } switch (rank % 10) { case 1: cout << rank << "st" << endl; break; case 2: cout << rank << "nd" << endl; break; case 3: cout << rank << "rd" << endl; break; default: cout << rank << "th" << endl; break; } return 0; }