#include <iostream>
#include <cmath>

using namespace std;

#define PI 3.14159265358979323846264338327950288

int main(){

	int m, n;
	int v, vsum;
	double area1=0, area2=0;

	while(1){

		cin >> m;
		if(m == 0) break;

		vsum = 0;
		for(int i = 0; i < m - 1; i++){
			cin >> v;
			vsum += v;
			area1 += sin(v * PI / 180.0);
		}
		area1 += sin((360 - vsum) * PI / 180.0);

		cin >> n;

		vsum = 0;
		for(int i = 0; i < n - 1; i++){
			cin >> v;
			vsum += v;
			area2 += sin(v * PI / 180.0);
		}
		area2 += sin((360 - vsum) * PI / 180.0);

		if(area1 == area2) cout << "0" << endl;
		else if(area1 > area2) cout<< "1" << endl;
		else cout<< "2" << endl;

	}

	return 0;
}