#include<iostream>
#include<cmath>
#include<cstdio>

using namespace std;
static double EPS = 1.0e-10;

bool is_zero(const double x){ return abs(x)<EPS; }
double get_area(const double& t){ return sin(t*M_PI/180.0)/2; }

double solve(const int& n){
  double ans=0;
  double t, t_=360;
  for(int i=0; i<n-1; ++i){
    cin >> t;
    t_-=t;
    ans+=get_area(t);
  }
  ans+=get_area(t_);
  return ans;
}

int main(){
  int n, m;
  while(cin >> n && n){
    double a=solve(n);
    cin >> m;
    double b=solve(m);
    if(is_zero(a-b)) printf("0\n");
    else if(a>b) printf("1\n");
    else printf("2\n");
  }
  return 0;
}