#include<stdio.h>
#include<math.h>
int main(){
	double PI=3.14159265359;
	int a;
	while(scanf("%d",&a),a){
		double sa=0;
		int c;
		int now=360;
		for(int i=0;i<a-1;i++){
			scanf("%d",&c);
			now-=c;
			sa+=sin((double)c*PI/180);
		}
		sa+=sin((double)now*PI/180);
		double sb=0;
		int b;
		scanf("%d",&b);
		now=360;
		for(int i=0;i<b-1;i++){
			scanf("%d",&c);
			now-=c;
			sb+=sin((double)c*PI/180);
		}
		sb+=sin((double)now*PI/180);
		if(sa>sb+0.0000001)printf("1\n");
		else if(sb>sa+0.0000001)printf("2\n");
		else printf("0\n");
	}
}