
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
  int n, i, f;
  double d, dd, s1, s2;
  while (cin>>n, n) {
    s1 = s2 = 0;
    dd = 360.0;
    for (i = 1; i < n; i++) {
      cin>>d;
      dd -= d;
      s1 += sin(d * M_PI/180.0)/2.0;
    }
    s1 += sin(dd * M_PI/180.0)/2.0;
    cin>>n;
    dd = 360.0;
    for (i = 1; i < n; i++) {
      cin>>d;
      dd -= d;
      s2 += sin(d * M_PI/180.0)/2.0;
    }
    s2 += sin(dd * M_PI/180.0)/2.0;
    if (s1>s2) f = 1;
    else if (s1==s2) f = 0;
    else f = 2;
    cout<<f<<endl;
  }
  return 0;
}