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%10 > 3 or r%10 == 0)? "th" : (r%10 == 3)? "rd" : (r%10 == 2)? "nd" : "st"} "