#include #include #include #include #include #include #include #include #include #include using namespace std; #define INIT cin.tie(0); ios::sync_with_stdio(false); #define FOR(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) for(int i = 0; i < n; i++) int main() { INIT; int h, n; vector v; cin >> h >> n; v.push_back(h); int tmp; REP(i, n - 1){ cin >> tmp; v.push_back(tmp); } sort(v.begin(), v.end(), greater()); int idx; REP(i, v.size()){ if(h == v[i]){ idx = i + 1; break; } } if(idx % 10 == 1) cout << idx << "st" << endl; else if(idx % 10 == 2) cout << idx << "nd" << endl; else if(idx % 10 == 3) cout << idx << "rd" << endl; else cout << idx << "th" << endl; return 0; }