#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define rep(i,n) REP(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<ll, ll> pll;
 

 
const int INF = 1000000;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const ll LINF = 1e18;
const double PI = acos(-1);

double convert(int d){
	return PI*d/180;
}


int main(){
	int n, m, sum, t;
	double s1, s2;
	while(cin>>n && n){
		sum = 0;
		s1 = s2 = 0.0;
		rep(i, n-1){
			cin>>t;
			sum+=t;
			s1+=sin(convert(t));
		}
		s1+=sin(convert(360-sum));
		cin>>m;
		sum = 0;
		rep(i, m-1){
			cin>>t;
			sum += t;
			s2 += sin(convert(t));
		}
		s2 += sin(convert(360-sum));
		int ans;
		if(abs(s1-s2)<EPS){
			ans = 0;
		}
		else if(s1>s2){
			ans = 1;
		}
		else {
			ans = 2;
		}
		cout<<ans<<endl;
	}
}