#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair pii; typedef tuple t3; using namespace std; void solve() { int h, n; cin >> h >> n; vector v; v.emplace_back(h); for(int i = 2;i <= n;i++) { int hh; cin >> hh; v.emplace_back(hh); } sort(v.begin(), v.end()); int index = 1; for(auto e = v.rbegin();e != v.rend();e++) { if(*e == h) { if(index == 1) { cout << "1st" << endl; return; } if(index == 2) { cout << "2nd" << endl; return; } if(index == 3) { cout << "3rd" << endl; return; } cout << index << "th" << endl; return; } index++; } } int main() { solve(); return 0; }