#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF 1<<30

double dtor(double deg) {       // x¨WA
  return deg*M_PI/180;
}

int main() {
  int m;
  while(cin >> m, m) {
    m--;
    int v1[m];
    REP(i,m)
      cin >> v1[i];
    int n;
    cin >> n;
    n--;
    int v2[n];
    REP(i,n)
      cin >> v2[i];

    double s1 = 0;
    double s2 = 0;
    REP(i,m) 
      s1 += sin(dtor(v1[i]));
    REP(i,n)
      s2 += sin(dtor(v2[i]));
    if (abs(s1-s2)<1e-10)
      cout << 0;
    else if (s1>s2)
      cout << 1;
    else
      cout << 2;
    cout << endl;
  }
}