h_nama, n = gets.chomp.split.map &:to_i rank = 1 n.times { h = gets.to_i if h > h_nama rank += 1 end } print rank puts case rank.to_s[-1].to_i when 1 "st" when 2 "nd" when 3 "rd" else "th" end