#include using namespace std; void selection_sort(int n, int A[]){ for(int i = 0; i < n; i++){ int minj = i; for(int j = i; j < n; j++){ if(A[minj] > A[j]){ minj = j; } } int temp = A[minj]; A[minj] = A[i]; A[i] = temp; } return; } int main(){ int nama, n; cin >> nama >> n; int height[n]; height[0] = nama; for(int i = 1; i < n; i++) cin >> height[i]; selection_sort(n,height); int rank; for(int i = 0; i < n ; i++){ if(height[i] == nama){ rank = n-i; break; } } if(rank == 1 || (rank-1)%10 == 0) cout << rank << "st" << endl; else if(rank == 2 || (rank-2)%10 == 0) cout << rank << "nd" << endl; else if(rank == 3 || (rank-3)%10 == 0) cout << rank << "rd" << endl; else cout << rank << "th" << endl; //for(int i = 0; i < n; i++) cout << height[i] << " "; return 0; }