#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 == 1) { printf("1st\n"); }else if (i+1 == 2) { printf("2nd\n"); }else if (i+1 == 3) { printf("3rd\n"); }else{ printf("%dth\n",i+1); } return 0; }