#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Ma_PI 3.141592653589793 #define eps 0.00000000000000000000000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) int main() { int a, b; cin >> a >> b; vector geko; geko.push_back(a); REP(i, b - 1) { int c; cin >> c; geko.push_back(c); } sort(geko.begin(), geko.end(), greater()); for (int i = 0;i < geko.size();++i) { if (geko[i] == a) { if (i%10 == 0) { cout << i+1<<"st" << endl; } else if (i%10 == 1) { cout << i+1 <<"nd" << endl; } else if (i%10 == 2) { cout << i+1 << "rd" << endl; } else { cout << i + 1 << "th" << endl; } return 0; } } }