#include <cstdio>
#include <cstring>
#include <cmath>
#define EPS 1e-9
int m,n;
double v[1000];
double s[2];

int check(){
	if(s[0]>s[1]+EPS)return 1;
	if(s[1]>s[0]+EPS)return 2;
	return 0;
}

int main(void){
	while(1){
		scanf("%d",&m);
		if(m==0)break;
		s[0]=s[1]=0.0;
		double rest=360.0;
		for(int i=0;i<m-1;i++){
			scanf("%lf",&v[i]);
			rest-=v[i];
			v[i]=v[i]/180.0*M_PI;
			s[0]+=sin(v[i]);
		}
		s[0]+=sin(rest/180.0*M_PI);
		scanf("%d",&n);
		rest=360.0;
		for(int i=0;i<n-1;i++){
			scanf("%lf",&v[i]);
			rest-=v[i];
			v[i]=v[i]/180.0*M_PI;
			s[1]+=sin(v[i]);
		}
		s[1]+=sin(rest/180.0*M_PI);
		printf("%d\n",check());
	}
	return 0;
}