#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;(i)<(n);(i)++) #define ll long long int main() { int h, N; int H[102]; cin >> h >> N; REP(i, N) { if (i == 0) { H[i] = h; continue; } cin >> H[i]; } sort(H, H + N); //REP(i, N) { // cout << H[i] << " "; //} //cout << endl; int a = 0; REP(i, N) { if (H[i] == h) a = i + 1; } //cout << a << endl; a = N - a + 1; //cout << a << endl; int b; if ((a - 1) % 10 == 0) b = 1; else if ((a - 2) % 10 == 0)b = 2; else if ((a - 3) % 10 == 0) b = 3; else b = 4; //cout << a << endl; cout << a << (b == 1 ? "st" : (b == 2 ? "nd" : (b == 3 ? "rd" : "th"))) << endl; return 0; }