#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int n,m;
	while(cin>>n,n){
		double sum=0;
		int sumi=0;
		rep(i,n-1){
			int in;
			cin>>in;
			sum+=10000.0*sin(in*PI/180.0);
			sumi+=in;
		}
		sum+=10000.0*sin((360-sumi)*PI/180.0);
		cin>>n;
		double sumq=0;
		int sumiq=0;
		rep(i,n-1){
			int in;
			cin>>in;
			sumq+=10000.0*sin(in*PI/180.0);
			sumiq+=in;
		}
		sumq+=10000.0*sin((360-sumiq)*PI/180.0);
		if(sum>sumq)cout<<1<<endl;
		else if(sum<sumq)cout<<2<<endl;
		else cout<<0<<endl;
	}
}