#include<iostream>
#include<cmath>

#define PI (acos(-1.0))
#define RAD(v) ((v)*(PI/180.0))
#define RADIUS 16
#define EPS 1.0e-10

using namespace std;

int main(){
	while(true){
		int m1,m2;
		int sumv1=0, sumv2=0;
		double area1 = 0, area2 = 0;

		scanf("%d", &m1);
		if( m1 == 0 )
			break;
		for(int i = 0; i < m1 - 1; ++i){
			int v;
			scanf("%d", &v);
			sumv1+=v;
			area1 += 0.5 * RADIUS * RADIUS * sin( RAD(v) );
		}
		area1 += 0.5 * RADIUS * RADIUS * sin( RAD(360-sumv1) );
		
		scanf("%d", &m2);
		for(int i = 0; i < m2 - 1; ++i){
			int v;
			scanf("%d", &v);
			sumv2+=v;
			area2 += 0.5 * RADIUS * RADIUS * sin( RAD(v) );
		}
		area2 += 0.5 * RADIUS * RADIUS * sin( RAD(360-sumv2) );
		
		if( std::abs( area1 - area2 ) < EPS )
			cout << "0\n";
		else if( area1 > area2 )
			cout << "1\n";
		else
			cout << "2\n";
	}
	return 0;
}