#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
const double EPS = 1e-12;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
#define EQ(a,b) (abs((a)-(b)) < EPS)
typedef complex<double> P;
typedef vector<P> G;

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}

double calc(int N){
  int sd = 0.0;
  double sum = 0.0;
  REP(i, N - 1){
    int d; cin >>d;
    sd += d;
    sum += sin(d * M_PI / 180.0);
  }
  sum += sin((360.0 - sd) * M_PI / 180.0);
  return sum;
}

int main() {
  int N;
  while(cin >>N && N){
    double a = calc(N);
    cin >>N;
    double b = calc(N);
    cout <<(EQ(a, b) ? 0 : (a > b ? 1 : 2)) <<endl;
  }
  return 0;
}