#include #include #include #include #include #include using namespace std; #define REP(i, j) for (int i = 0; i < (int)j; ++i) #define FOR(i, j, k) for (int i = (int)j; i < (int)k; ++i) #define SORT(v) sort(v.begin(), v.end()) #define REVERSE(v) reverse(v.begin(), v.end()) typedef complex P; typedef vector VI; typedef long long LL; typedef pair PII; int main() { cin.tie(0); ios::sync_with_stdio(false); int h, n; cin >> h >> n; VI hs; REP(i,n-1) { int high; cin >> high; hs.push_back(high); } sort(hs.begin(), hs.end(), greater()); bool isWorst = true; REP(i,hs.size()) { if (hs[i] < h) { string suff = "th"; switch((i+1)%10) { case 1: suff = "st"; break; case 2: suff = "nd"; break; case 3: suff = "rd"; break; } cout << to_string(i+1) + suff << endl; isWorst = false; break; } } if (isWorst) { string suff = "th"; switch(n) { case 1: suff = "st"; break; case 2: suff = "nd"; break; case 3: suff = "rd"; break; } cout << to_string(n) + suff << endl; } return 0; }