#include <iostream>
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
using namespace std;

int main() {
 double h[2],g,s;
 int n,i,j;
 while(true) {
	 for (i=0;i<2;i++) {
		 cin >> n;
		 h[i]=0;
		 if (n==0) return 0;
		 for (j=0,s=0;j<n-1;j++) {
			 cin >> g; s+=g;
			 h[i]+=sin(PI*g/180);
		 }
         h[i]+=sin(PI*(360-s)/180);
	 }
	 cout << (h[0]>h[1])+(h[0]<h[1])*2 << endl;
 }
 return 0;
 }