#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-8;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int m;
  while(cin>>m){
    if(m==0) break;
    double s1=0,s2=0;
    int t1=0,t2=0;
    REP(i,m-1){
      int t;
      cin>>t;
      s1 += sin((double)t*M_PI/180);
      t1 += t;
    }
    s1+=sin((double)(360-t1)*M_PI/180);
    cin>>m;
    REP(i,m-1){
      int t;
      cin>>t;
      s2 += sin((double)t*M_PI/180);
      t2 += t;
    }
    s2 += sin((double)(360-t2)*M_PI/180);
    if(abs(s1-s2)<EPS){
      cout<<0<<endl;
    }else if(s1>s2){
      cout<<1<<endl;
    }else if(s2>s1){
      cout<<2<<endl;
    }
  }
  return 0;
}