#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef vector VVL; typedef pair P; typedef pair PL; int main(){ int x, n; cin >> x >> n; VI h; h.push_back(x); REP(i,n-1){ int p; cin >> p; h.push_back(p); } sort(ALL(h)); reverse(ALL(h)); int ans = 0; REP(i,n) if (h[i] == x) ans = i+1; cout << ans; if (ans % 10 == 1) cout << "st"; else if (ans % 10 == 2) cout << "nd"; else if (ans % 10 == 3) cout << "rd"; else cout << "th"; cout << endl; return 0; }