#include #include #include #include int main() { int h, n; std::cin >> h >> n; std::vector hi(n); hi[0] = h; for (int i = 1; i < n; i++) { std::cin >> hi[i]; } std::sort(hi.begin(), hi.end(), std::greater()); int r = std::find(hi.begin(), hi.end(), h) - hi.begin() + 1; std::string s = std::to_string(r); if (r % 10 == 1) { s += "st"; } else if (r % 10 == 2) { s += "nd"; } else if (r % 10 == 3) { s += "rd"; } else { s += "th"; } std::cout << s << std::endl; }