#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
using namespace std;
typedef complex<double> c;
int main(){

  int m;
  double deg,ta1,ta2,tp;
  cin>>m;
  while(m){
    ta1=0;tp=360;
    for(int i=0;i<m-1;i++){
      cin>>deg;
      ta1+=sin(deg/180*3.14);
      tp-=deg;
    }
    ta1+=sin(tp/180*3.14);
    
   
    ta2=0;tp=360;
    cin>>m;
    for(int i=0;i<m-1;i++){
      cin>>deg;
      ta2+=sin(deg/180*3.14);
      tp-=deg;
    }
    ta2+=sin(tp/180*3.14);
    
    
    if(ta1>ta2) cout<<1<<endl;
    if(ta1<ta2) cout<<2<<endl;
    if(ta1==ta2) cout<<0<<endl;
    cin>>m;
  }
  return 0;
}