#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { vector heights; int n = 0; int myheght = 0; cin >> myheght; int tmp = 0; heights.push_back(myheght); cin >> n; for (int i = 0; i < n - 1; i++) { cin >> tmp; heights.push_back(tmp); } sort(heights.begin(), heights.end(), greater()); for (int i = 0; i < heights.size(); i++) { if (heights[i] == myheght) { if (i == 0) { cout << i+1 << "st" << endl; } else if (i == 1) { cout << i+1 << "nd" << endl; } else if (i == 2) { cout << i+1 << "rd" << endl; } else { cout << i+1 << "th" << endl; } } } return 0; }