#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

static const double eps = 10e-8;

int main(){

	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;

		double areaA=0,areaB=0;
		for(int i=0;i<n-1;i++){
			double rad;
			scanf("%lf",&rad);
			rad = rad / 180 * M_PI;
			areaA += sin(rad);
		}

		scanf("%d",&n);
		for(int i=0;i<n-1;i++){
			double rad;
			scanf("%lf",&rad);
			rad = rad / 180 * M_PI;
			areaB += sin(rad);
		}

		printf("%d\n",areaA == areaB ? 0 :
			areaA > areaB ? 1 : 2);
	}
}