def order(n) case n when 1; "1st" when 2; "2nd" when 3; "3rd" else; "#{n}th" end end H, N = gets.split.map(&:to_i) S = Array.new(N + 1, H) (1 .. N).each{|i|S[i] = gets.to_i} S.sort!.reverse! puts order(S.index(H) + 1)