#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-8;

int main(){
	int m;
	while(1){
		cin >> m;
		if(m==0) break;
		
		vector<double> area(2, 0);
		for(int i=0; i<2; i++){
			if(i==1) cin >> m;
			int deg = 360;
			for(int j=0; j<m-1; j++){
				int v;
				cin >> v;
				deg -= v;
				area[i] += sin(v*PI/180);
			}
			area[i] += sin(deg*PI/180);
		}
		if(area[0] > area[1] +EPS){
			cout << 1 << endl;
		}else if(area[0] +EPS < area[1]){
			cout << 2 << endl;
		}else{
			cout << 0 << endl;
		}
	}
	return 0;
}
