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

int main()
{
	int n, i;
	double d, dd, s1, s2;
	while (cin>>n, n) {
		s1 = s2 = 0;
		dd = 360.0;
		for (i = 1; i < n; i++) {
			cin>>d;
			dd -= d;
			s1 += sin(M_PI * d/180.0);
		}
		s1 += sin(M_PI * dd/180.0);
		cin>>n;
		dd = 360.0;
		for (i = 1; i < n; i++) {
			cin>>d;
			dd -= d;
			s2 += sin(M_PI * d/180.0);
		}
		s2 += sin(M_PI * dd/180.0);
		if (s1>s2) cout<<1<<endl;
		else if (s1==s2) cout<<0<<endl;
		else cout<<2<<endl;
	}
	return 0;
}