import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char
import Data.Ratio
import Data.Ord
import Data.Array.IO

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete


main = do
    ls <- map (map readInt . wordsBy (==',')) . lines <$> getContents
    forM_ ls $ \line -> do
        let ls = take 10 line
        let [v1,v2] = drop 10 line
        let sl = scanl (+) 0 ls
        let dist = (v1 * last sl) % (v1 + v2)
        print $ fst $ head $ dropWhile ((<dist) . (%1) . snd) $ zip [1..10] $ tail sl
        