#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>

using namespace std;

const double Eps = 1e-4;
const double PI = 4*atan(1.0);

int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		double area[2];
		area[0] = area[1] = 0;
		for (int w = 0; w < 2; ++w)
		{
			int s = 0;
			for (int i = 1; i < n; ++i)
			{
				int v;
				scanf("%d", &v);
				s += v;
				area[w] += sin(v*PI/180);
			}
			area[w] += sin((360-s)*PI/180);
			if (!w)
				scanf("%d", &n);
		}
		if (abs(area[0] - area[1]) < Eps)
			puts("0");
		else if (area[0] > area[1])
			puts("1");
		else
			puts("2");
	}

	return 0;
}