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

#define PI	3.1415926535
#define EPS	0.00000000001

int main()
{
	int n,a;
	int a1,a2;
	double h1,h2;
	while(cin >> n, n)
	{
		a1=a2=0;
		h1=h2=0;
		while(--n)
		{
			cin >> a;
			a1 += a;
			h1 += sin(a*PI/180.0);
		}
		cin >> n;
		while(--n)
		{
			cin >> a;
			a2 += a;
			h2 += sin(a*PI/180.0);
		}

		h1 += sin((360-a1)*PI/180.0);
		h2 += sin((360-a2)*PI/180.0);

		//if(-EPS<h1-h2 && h1-h2<EPS)
		if(h1==h2)
		{
			cout << 0 << endl;
		}
		else if(h1>h2)
		{
			cout << 1 << endl;
		}
		else
		{
			cout << 2 << endl;
		}
	}

	return 0;
}