def foo
  while input = gets
    inputs = input.split(',').map(&:to_i)
    sections = inputs[0..9]
    v1, v2 = inputs[10..11]
    time = sections.inject(:+).to_f / (v1 + v2)
    vkm = time * v1
    sections.each.with_index do |e, i|
      vkm -= e
      if vkm <= 0
        puts i + 1
        break
      end
    end
  end
end

foo