#include #include #include #include using namespace std; int main() { vector heights; int H, N; scanf("%d%d", &H, &N); heights.push_back(H); for (int i = 1; i < N; i++) { int hi; scanf("%d", &hi); heights.push_back(hi); } sort(heights.begin(), heights.end(), greater()); int rank = 0; for (int i = 0; i < N; i++) { if (heights[i] == H) { rank = i + 1; break; } } if (rank == 1) printf("%dst", rank); else if (rank == 2) printf("%dnd", rank); else if (rank == 3) printf("%drd", rank); else printf("%dth", rank); }