import Data.List import Control.Applicative import Control.Monad main = do n <- readLn exp <- (map . map) read . map words <$> replicateM n getLine let exp' = take 6 . reverse . sort $ map (\x -> (fst x, snd x !! 0 - 30000 * (snd x !! 1))) $ zip [1..] exp if foldl' (\acc x -> acc + snd x ) 0 exp' >= 3000000 then do putStrLn "YES" mapM_ print $ map fst exp' else putStrLn "NO"