// 0166
#include <iostream>
#include <math.h>
#define  PI   3.14159265
using namespace std;

void area_com(int m, double &s){
	int d, deg = 0;

	for(int i=1;i<m;i++){
		cin>>d;
		s += sin(d*PI/180);
		deg += d;
	}
	s += sin((360-deg)*PI/180);
}

int main(){
	while(1){
		int m, n;
		double s1 = 0, s2 = 0;

		cin>>m;
		if(m == 0)
			break;
		
		area_com(m, s1);
		
		cin>>n;
		area_com(n, s2);

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