#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <deque>
#include <cstdio>
#include <cmath>
#include <complex>
#include <iostream>
#include <iterator>

using namespace std;

#define reep(i,f,t) for(int i=f ; i<int(t) ; ++i)
#define rep(i,n) reep(i, 0, n) 

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

const double EPS = 1e-10;

int main()
{
	int m;
	while(scanf("%d", &m), m){
		double sm1 = 0.0;
		rep(i, m-1){
			int deg;
			scanf("%d", &deg);
			sm1 += sin(deg*M_PI/180.0);
		}
		
		int n;
		scanf("%d", &n);
		
		double sm2 = 0.0; 
		rep(i, n-1){
			int deg;
			scanf("%d", &deg);
			sm2 += sin(deg*M_PI/180.0);
		}
		
		if(fabs(sm1 - sm2) < EPS)
			puts("0");
		else
			puts(sm1>sm2 ? "1" : "2");
	}
}