#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int m,v,n,count=0,count1=0;
    double S[10001];

  while(cin >> m && m!=0){
    S[count]=0; S[count+1]=0;
    count1++;

    for(int i=0;i<m-1;i++){
  
      cin >> v ;
   
      S[count]+= sin(v*3.14159/180.0);
    }
 
    cin >> n;
    
    for(int j=0;j<n-1;j++){
    
      cin >> v;
      
      S[count+1]+= sin(v*3.14159/180.0);
    }
    
    count+=2;
  
  }

  for(int i=0;i<count1*2;i+=2){

    if(S[i]==S[i+1]){
      cout << 0 << endl;}
    else if(S[i]>S[i+1]){
      cout << 1<< endl;}
    else if(S[i]<S[i+1]){
      cout << 2<< endl;}
  }

  

  return 0;
}