#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int n=2;
	vector<int> p[2];
	int ans[2];
	for(int i=0;i<n;++i){
		for(int j=0,point;j<10;++j){
			cin>>point;
			p[i].push_back(point);
		}
		sort(p[i].begin(),p[i].end(),greater<int>());
		ans[i]=p[i][0]+p[i][1]+p[i][2];
	}
	for(int i=0;i<n;++i)cout<<ans[i]<<((i==n-1)?"\n":" ");
	return 0;
}
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdio>

using namespace std;

int main(){
	int a[12];
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"
				,&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&a[10],&a[11]) != EOF){

		int ans = 0;	
		double t = 0, d = 0;
		int sum = 0;
		for(int i = 0;i < 10;i++){
			sum += a[i];
		}
		t = (double)sum / (a[10]+a[11]);
		d = (double)a[10] * t;
		sum = 0;
		for(int i = 0;i < 10;i++){
			sum += a[i];
			if(sum >= d){
				ans = i + 1;
				break;
			}
		}
		cout << ans << endl;
	}

	return 0;
}