open System type Sol() = member this.Solve() = let N = stdin.ReadLine() |> int let mutable gain : (int*int) list = [] for i = 0 to (N-1) do gain <- ( (( stdin.ReadLine().Split() |> fun ss -> (int ss.[0]) - 30000*(int ss.[1]) ),(i+1)) :: gain ) gain |> List.sortWith (fun (p:(int*int)) (q:(int*int)) -> (fst p).CompareTo(fst q)) |> List.rev let ans = if ((fst gain.[0]) * 6) >= 3000000 then "YES" else "NO" printfn "%s" ans if ans = "YES" then for i=0 to 5 do printfn "%d" (snd gain.[0]) let mySol = new Sol() mySol.Solve()