#include #include #include using namespace std; int main(){ int H, N; cin >> H >> N; int height; int ans; vector v; for(int i = 0; i < N - 1; i++){ cin >> height; v.push_back(height); } v.push_back(H); sort(v.begin(), v.end()); reverse(v.begin(), v.end()); for(int i = 0; i < N; i++){ if(v[i] == H) ans = i + 1; } if(ans == 1){ cout << ans << "st" << endl; }else if(ans == 2){ cout << ans << "nd" << endl; }else if(ans == 3){ cout << ans << "rd" << endl; }else{ cout << ans << "th" << endl; } return 0; }