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

double area(int n){
	double r = 10, s = 0, rem = 360;

	for(int i=0;i<n;i++){
		double v;

		if(i == n-1){ v = rem; }
		else{ cin>>v; rem -= v; }

		double rad = M_PI * v / 180;
		s += r * r * sin(rad) / 2;
	}

	return s;
}

int main(void){
	int n,m;

	while(cin>>n && n){
		double s1 = area(n);

		cin>>m;
		double s2 = area(m);

		if(fabs(s1 - s2) < 0.00001) cout<<0<<endl;
		else if(s1 > s2) cout<<1<<endl;
		else cout<<2<<endl;
	}

	return 0;
}