#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int m,v,n;
  double S1,S2;

  while(cin >> m && m!=0){
    S1=0; S2=0;

    for(int i=0;i<m-1;i++){
  
      cin >> v ;
   
      S1+=sin(v*3.14159/180.0);
    }
    cin >> n;
    
    for(int j=0;j<n-1;j++){
    
      cin >> v;
      
      S2+=sin(v*3.14159/180.0);
    }
    
     if(S1==S2){
      cout << 0 << endl;}
    else if(S1>S2){
      cout << 1<< endl;}
    else if(S1<S2){
      cout << 2<< endl;}
  }

  

  return 0;
}