#include<iostream>
#include<cmath>
using namespace std;

int m;
double *v;
double a[2];
double tmp;

int main(){
	while(true){
		for(int k=0; k<2; k++){
			cin >> m;
			if(!m)
				return 0;

			a[k] = 0;
			tmp = 0;

			v = new double[m];
			for(int i=0; i<m-1; i++){
				cin >> v[i];
				tmp += v[i];
			}
			v[m-1] = 360-tmp;

			for(int i=0; i<m; i++)
				a[k] += sin(v[i]*M_PI/360)*cos(v[i]*M_PI/360);
			delete[] v;
		}

		if(a[0] == a[1])
			cout << 0 << endl;
		else if(a[0] > a[1])
			cout << 1 << endl;
		else
			cout << 2 << endl;
	}
}