#include <iostream>
#include <cmath>
using namespace std;
main(){
  int m;
  while(1){
    int sum=0;
    int r=1;
    double s1=0, s2=0;
    cin >> m;
    if(m==0) break;
    for(int i=0;i<m;i++){
      double a, b;
      int k;
      if(i==m-1){
        k=360-sum;
        s1+=sin(((double)k/180)*M_PI);
      }
      else{
        cin >> k;
        sum+=k;
        s1+=sin(((double)k/180)*M_PI);
      }
    }
    int n;
    cin >> n;
    sum=0;
    for(int i=0;i<n;i++){
      double a, b;
      int k;
      if(i==n-1){
        k=360-sum;
        s2+=sin(((double)k/180)*M_PI);
      }
      else{
        cin >> k;
        sum+=k;
        s2+=sin(((double)k/180)*M_PI);
      }
    }
    if(s1>s2) cout << 1 << endl;
    else if(s1<s2) cout << 2 << endl;
    else cout << 0 << endl;
  }
  return 0;
}