#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#define EPS 0.0000001
using namespace std;

double getRad(int n){
  return (180*n)/M_PI;
}

int main(){

  int N,thita,thita2;

  while(1){
    double s1=0,s2=0;
    thita2=0;
    cin>>N;
    if(N==0) break;
    for(int i=0;i<N-1;i++){
      cin>>thita;
      thita2+=thita;
      s1+=abs( sin( getRad(thita) ) );
    }
    s1+=abs( sin( getRad(360-thita2) ));
    thita2=0;
    cin>>N;
    for(int i=0;i<N-1;i++){
      cin>>thita;
      thita2+=thita;
      s2+=abs( sin( getRad(thita) ) );
    }
    s2+=abs( sin( getRad(360-thita2) ));
    if(fabs(s1-s2)<EPS) cout<<0<<endl;
    else if(s1>s2) cout<<1<<endl;
    else cout<<2<<endl;
  }
  return 0;
}