#include <iostream>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

void solve()
{
	int m;
	while(cin >>m, m)
	{
		double angle_remain1 = 360;
		double angle1;
		double sum1 = 0;
		for(int i = 1; i < m; ++i)
		{
			cin >> angle1;
			angle_remain1 -= angle1;
			sum1 += sin(angle1 / 180 * M_PI);
		}
		sum1 += sin(angle_remain1 / 180 * M_PI);
		int n;
		cin >> n;
		double angle_remain2 = 360;
		double angle2;
		double sum2 = 0;
		for(int i = 1; i < n; ++i)
		{
			cin >> angle2;
			angle_remain2 -= angle2;
			sum2 += sin(angle2 / 180 * M_PI);
		}
		sum2 += sin(angle_remain2 / 180 * M_PI);
		if(fabs(sum1 - sum2) < 0.000000001)
		{
			cout << 0 << endl;
		}
		else if(sum1 > sum2)
		{
			cout << 1 << endl;
		}
		else if(sum1 < sum2)
		{
			cout << 2 << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}