$n=<>; for(1..$n){ ($g,$d)=<>=~/\d+/g; if($b<$g-$d*30000){ $i=$_; $b=$g-$d*30000; } } if($b*6>=3e6){ print"YES\n",($i.$/)x6; }else{ print"NO\n"; }