n=gets.to_i stage=[] n.times{|i| g,d=gets.split(" ").map!(&:to_i) stage+=[[g-30000*d,i]] } stage.sort!{|l,r| r[0]<=>l[0]} if (stage[0][0]*6<30000*100) puts "NO" else puts "YES" 6.times{puts stage[0][1]+1} end