h,n = gets.chomp.split.map(&:to_i) rank = 1 (n - 1).times do if gets.chomp.to_i > h rank += 1 end end rank = rank.to_s if rank == '1' puts rank + 'st' elsif rank == '2' puts rank + 'nd' elsif rank == '3' puts rank + 'rd' else puts rank + 'th' end