n=STDIN.gets.to_i e=0 no=-1 n.times do |i| a,b=STDIN.gets.split(" ") t=a.to_i-b.to_i*30000 if t>e then e=t no=i+1 end end if e*6>=3000000 then puts "YES" 6.times do |i| puts no end else puts "NO" end