#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
double pai = acos(-1.0);
int main(){
  int n;
  while( cin >> n , n){
    double suma = 0,sumb = 0;
    double s = 360;
    for(int i = 0 ; i < n-1 ; i++ ){
      double m;
      cin >> m;
      suma += (0.5)*sin((m/180.0)*pai); 
      s -= m;
    }
    suma += (0.5)*sin((s/180.0)*pai); 
    s = 360;
    cin >> n;
    for(int i = 0 ; i < n-1 ; i++ ){
      double m;
      cin >> m;
      sumb += (0.5)*sin((m/180.0)*pai);
      s -= m; 
    }
    sumb += (0.5)*sin((s/180.0)*pai); 
    if((float)suma > (float)sumb)cout << 1;
    else if((float)suma < (float)sumb)cout << 2;
    else cout << 0;
    cout << endl;
  }
  return 0;
}