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

int main(){
  int m,n,v,tmp;
  double s1,s2;

  while(1){
    cin >> m;
    if(!m)break;

    s1 = 0.0;
    tmp = 360;
    for(int i=1;i<m;i++){
      cin >> v;
      tmp -= v;
      s1 += sin(M_PI*v/180);
    }
    s1 += sin(M_PI*tmp/180);

    cin >> n;
    s2 = 0.0;
    tmp = 360;
    for(int i=1;i<n;i++){
      cin >> v;
      tmp -= v;
      s2 += sin(M_PI*v/180);
    }
    s2 += sin(M_PI*tmp/180);


    if(s1>s2)cout << 1 << endl;
    else if(s1<s2)cout << 2 << endl;
    else cout << 0 << endl;
  }
}