h,x=gets.split.map{|e| e.to_i} hs=[] (x-1).times{ hs.push(gets.to_i) } hs=hs.sort.reverse ans=1 hs.each{|e| break if(h>e) ans+=1 } if ans<4 then puts ans.to_s+(["st","nd","rd"][ans-1]) else puts ans.to_s+"th" end