def order(n) case n % 10 when 1; "#{n}st" when 2; "#{n}nd" when 3; "#{n}rd" 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)