#define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

double get_area(double a){
	return sin(a) / 2;
}

int main(){
	int n, m;
	while(cin >> n && n){
		double sum1 = 0;
		double sum2 = 0;
		double area1 = 0;
		double area2 = 0;
		double theta;
		rep(i, n-1) {
			cin >> theta;
			area1 += get_area(theta / 180.0 * M_PI);
			sum1 += theta / 180.0 * M_PI;
		}
		area1 += get_area(2 * M_PI - sum1);
		area1 = abs(area1);
		cin >> m;
		rep(i, m-1){
			cin >> theta;
			area2 += get_area(theta / 180.0 * M_PI);
			sum2 += theta / 180.0 * M_PI;
		}
		area2 += get_area(2 * M_PI - sum2);
		area2 = abs(area2);
		if(abs(area1 - area2) < EPS) cout << 0 << endl;
		else if(area1 > area2) cout << 1 << endl;
		else cout << 2 << endl;
	}
	return 0;
}