#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j, k; int h, n; vectornum; cin >> h >> n; //n--; //num.push_back(-1); for (i = 0; i < n-1; i++) { int nn; cin >> nn; num.push_back(nn); } sort(num.begin(), num.end(), greater()); num.insert(num.begin() + 0, -1); bool flag = false; for (i = 1; i < n; i++) { if (num[i] < h) { string st; int ii = i % 10; if (ii == 1) st = "st"; if (ii == 2) st = "nd"; if (ii == 3) st = "rd"; if (ii >= 4 || ii== 0) st = "th"; cout << i << st << endl; flag = true; break; } } //n++; if (flag == false) { string st; int nnn = n % 10; if (nnn == 1) st = "st"; if (nnn == 2) st = "nd"; if (nnn == 3) st = "rd"; if (nnn >= 4 || nnn == 0 ) st = "th"; cout << n << st << endl; } getchar(); getchar(); return 0; }