#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;
#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()]
const double EPS = 1e-12;
#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 area2(const G &P) {
  double A = 0.0;
  for (int i = 0; i < P.size(); ++i)
    A += cross(curr(P, i), next(P, i));
  return A / 2.0;
}
 
P rotation(P v, double r){
  return P(v.real() * cos(r) - v.imag() * sin(r), v.real() * sin(r) + v.imag() * cos(r));
}
 
double calc(int N){
  G a(N);
  a[0] = P(1, 0);
  double r = 0.0;
  FOR(i, 1, N){
    int d; cin >>d;
    r += d * M_PI / 180.0;
    a[i] = rotation(P(1, 0), r);
  }
  return area2(a);
}
 
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;
}