#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999
#define EPS 1e-9
#define PI 3.14159265358979323846
double calc(int theta){
    return sin(theta/360.0*PI)*cos(theta/360.0*PI);
}


double solve(vector<int> data){
    double ret=0;
    rep(i,data.size()){
        ret+=calc(data[i]);
    }
    return ret;
}


int main(){
    int n,m;
    while(cin>>n){
        if(n==0)break;
        double s1,s2;
        vector<int> data;
        int less=360;
        rep(i,n-1){
            int a;
            cin>>a;
            less-=a;
            data.pb(a);
        }
        data.pb(less);
        s1 = solve(data);
        
        less=360;
        data.clear();
        cin>>m;
        rep(i,m-1){
            int a;
            cin>>a;
            less-=a;
            data.pb(a);
        }
        data.pb(less);
        s2 = solve(data);
        if(fabs(s1-s2)<EPS)cout<<0<<endl;
        else if(s1>s2)cout<<1<<endl;
        else if(s1<s2)cout<<2<<endl;
    }
}