#include #include #include int compare(const void *a,const void *b){ return -1 * (*(int*)a - *(int*)b); } int main(void) { int H,N; scanf("%d%d",&H,&N); int a[N-1],i; for (i = 0; i < N-1; i++) { scanf("%d",&a[i]); } i = 0; qsort(a, N - 1, sizeof(int), compare); while (H < a[i]) { i++; } if ((i+1) % 10 == 1) { printf("%dst\n",i+1); }else if ((i+1) % 10 == 2) { printf("%dnd\n",i+1); }else if ((i+1) % 10 == 3) { printf("%drd\n",i+1); }else{ printf("%dth\n",i+1); } return 0; }