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

int main(){
	int m,n;
	const double pi = 3.14159265358979;
	const double EPS = 1e-10;

	while( cin >> m , m ){
		int v, angleA=0, angleB=0;
		vector<int> a,b;

		for(int i=0 ; i < m-1 ; i++ ){
			cin >> v;
			a.push_back( v );
			angleA += v;
		}
		cin >> n;
		for(int i=0 ; i < n-1 ; i++ ){
			cin >> v;
			b.push_back( v );
			angleB += v;
		}

		a.push_back( 360 - angleA );
		b.push_back( 360 - angleB );
		double sa=0.0, sb=0.0;
		for(int i=0 ; i < a.size() ; i++ ){
			sa += sin( a[i]*pi/180.0 );
		}
		for(int i=0 ; i < b.size() ; i++ ){
			sb += sin( b[i]*pi/180.0 );
		}

		if( fabs(sa-sb) < EPS )
			cout << 0 << endl;
		else if( sa > sb )
			cout << 1 << endl;
		else 
			cout << 2 << endl;
	}
}