#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) REP((i),0,(n))
#define RREP(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define rrep(i,n) RREP(i,n,0)
#define each(it,X) for(__typeof((X).begin())  it=(X).begin();it!=(X).end();it++)
#define all(v) ((v).begin(),(v).end())
#define fi first
#define se second
#define pb push_back
typedef pair<int,int>pr;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef set<int>si;
const int INF=1070000000ll;
const int mod=1000000007ll;
const double EPS=1e-9;
const double PI=3.14159265;
double getS(int x){
    int d=360;
    double S=0;
    rep(i,x-1){
        int z;cin>>z;
        d-=z;
        S+=fabs(sin(1.0*z/180*PI));
    }
    S+=fabs(sin(1.0*d/180*PI));
    return S;
}
signed main(){
    cin.tie(0);ios_base::sync_with_stdio(0);
    double S[2];

    int x;
    while(cin>>x,x){
        S[0]=getS(x);
        scanf("%d",&x);
        S[1]=getS(x);
        if(fabs(S[0]-S[1])<EPS)cout<<0<<endl;
        else if(S[0]>S[1])cout<<1<<endl;
        else cout<<2<<endl;
    }
    return 0;
}