#include #include #include #include #include #include #include #include #include // complex a(1.2 , 2.3);// real(): 1.2, imag()2.3 using namespace std; #define MOD 1000000007 #define ll long long #define ld long double #define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++) #define rep(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end()) int main(){ cin.tie(0); ios::sync_with_stdio(false); ll A, N; cin >> A >> N; vector H; H.pb(A); rep(i,N-1){ ll inp; cin >> inp; H.pb(inp);} sort(rall(H)); rep(i,N){ if(H[i]==A) { cout << i+1 ; if(i==0) cout << "st" << endl; else if(i==1) cout << "nd" << endl; else if(i==2) cout << "rd" << endl; else cout << "th" << endl; return 0; } } return 0; }