#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] = {0}; 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) cout << "1st" << endl; else if(rank == 2) cout << "2nd" << endl; else if(rank == 3) cout << "3rd" << endl; else cout << rank << "th" << endl; //for(int i = 0; i < n; i++) cout << height[i] << " "; return 0; }