#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
#define PI 3.141592653589793238462643L
int K[100000];
long double SIN(long double b) { return sinl(b * PI / 180.0L); }
int main() {
	int N, cnt = 0; long double a, sum, s[2], V;
	while (true) {
		for (int i = 0; i < 2; i++) {
			cin >> N; V = 0.0L; sum = 0.0L; if (N == 0) { goto E; }
			for (int i = 0; i < N - 1; i++) { cin >> a; sum += SIN(a); V += a; }
			sum += SIN(360.0L - V); s[i] = sum;
		}
		if (fabs(s[0] - s[1]) < 1e-9) { cout << '0' << endl; }
		else if (s[0] > s[1]) { cout << '1' << endl; }
		else if (s[0] < s[1]) { cout << '2' << endl; }
	}
E:;
	return 0;
}