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

int main(){
  int num;
  const double PI=3.14159265;
  while(cin>>num){
    if(num==0) break;
    double area1=0.0,area2=0.0;
    int degree1=360,degree2=360;
    for(int i=0;i<num-1;i++){
      int d;
      cin>>d;
      area1+=1.0/2*sin(PI/180*d);
      degree1 -=d;
    }
    area1 += 1.0/2*sin(PI/180*degree1);

    cin>>num;
    for(int i=0;i<num-1;i++){
      int d;
      cin>>d;
      area2+=1.0/2*sin(PI/180*d);
      degree2 -=d;
    }
    area2 += 1.0/2*sin(PI/180*degree2);
    if(area1 > area2) cout<<1<<endl;
    else if(area1 < area2) cout<<2<<endl;
    else cout<<0<<endl;
  }
  return 0;
}