#include #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair ; using pll = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; int main(){ int h,n; cin >> h >> n; vector H(n-1); rep(i,n-1) cin >> H[i]; sort(H.begin(),H.end()); int ans = lower_bound(H.begin(),H.end(),h) - H.begin(); ans = n - ans; if(ans==1) cout << ans << "st" << endl; else if(ans==2) cout << ans << "nd" << endl; else if(ans==3) cout << ans << "rd" << endl; else cout << ans << "th" << endl; return 0; }