#define _USE_MATH_DEFINES
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cmath>
#include<climits>
using namespace std;

const int EPS = 1e-8;

int main(){
	while(true){
		int N[2], V, V_;
		double S[2] = {};
		for(int i = 0; i < 2; i++){
			cin >> N[i];
			if(N[i] == 0) return 0;
			V_ = 360;
			for(int j = 0; j < N[i]-1; j++){
				cin >> V;
				V_ -= V;
				S[i] += sin(M_PI*V/180);
			}
			S[i] += sin(M_PI*V_/180);
		}
		if(S[0] - S[1] > EPS) puts("1");
		else if(S[1] - S[0] > EPS) puts("2");
		else puts("0");
	}
	return 0;
}