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


double degToRad(int deg) {
  return (double)deg*M_PI/180;
}
double calcS(int deg) {
  return sin(degToRad(deg));
}

main() {
  while(1) {
    int m;
    double S[2];
    bool flag = false;
    for(int t = 0; t < 2; t++) {
      S[t] = 0;
      cin >> m;
      if(m == 0) {
	flag = true;
	break;
      }
      int tmp = 0;
      for(int i = 0; i < m-1; i++) {
	int deg;
	cin >> deg;
	S[t] += calcS(deg);
	tmp += deg;
      }
      S[t] += calcS(360-tmp);
    }
    if(flag) break;
    if(S[0] > S[1]) cout << 1 << endl;
    else if(S[0] < S[1]) cout << 2 << endl;
    else            cout << 0 << endl;
  }
}