h ,n = gets.chomp.split.map &:to_i a = n.times.map{gets.to_i} r = n - a.push(h).sort.index(h) + 1 puts "#{r}#{(r > 3)? "th" : (r == 3)? "rd" : (r == 2)? "nd" : "st"} "