#include int main() { int H,N; std::cin >> H >> N; std::priority_queue high; high.push(H); int Ha; for(int a = 2; a <= N; ++a) { std::cin >> Ha; high.push(Ha); } int ans = 0; while(!high.empty()) { if(high.top() == H) { ++ans; break; }else{ ++ans; } high.pop(); } if(ans == 1) std::cout << "1st" << std::endl; if(ans == 2) std::cout << "2nd" << std::endl; if(ans == 3) std::cout << "3rd" << std::endl; if(ans >= 4) std::cout << ans << "th" << std::endl; }