#include using namespace std; void bsort(int n, int A[]){ int flag = 1; while(flag){ for(int i = n-1; i > 0 ; i--){ flag = 0; if(A[i] < A[i-1]){ int temp = A[i]; A[i] = A[i-1]; A[i-1] = temp; flag = 1; } } } return; } int main(){ int nama, n; cin >> nama >> n; int height[n]; for(int i = 1; i < n; i++) cin >> height[i]; height[0] = nama; bsort(n,height); int rank; for(int i = 0; i < n; i++){ if(height[i] == nama){ rank = n-i+1; 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; return 0; }