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

int main(void){
	double r = 10; //ツ板シツ径ツづー10ツづ可シツ津ィ
	int n,m;

	while(cin>>n && n){
		double s1 = 0;
		for(int i=0;i<n-1;i++){
			double v;
			cin>>v;
			double rad = M_PI * v / 180;
			s1 += r * r * sin(rad) / 2;
		}

		cin>>m;
		double s2 = 0;
		for(int i=0;i<m-1;i++){
			double v;
			cin>>v;
			double rad = M_PI * v / 180;
			s2 += r * r * sin(rad) / 2;
		}

		if(s1 > s2) cout<<1<<endl;
		else if(s1 < s2) cout<<2<<endl;
		else cout<<0<<endl;
	}

	return 0;
}