#include <iostream>
#include <complex>
#include <math.h>
using namespace std;

typedef complex<double> xy_t;

int M, N, VM[500], VN[500];


double area( int V[], int L ) {

	double suma = 0, sumv = 0;

	for ( int i = 0; i < L - 1; i++ ) {
	
		suma += sin( V[i] * atan( 1 ) / 45 );
		sumv += V[i];
	
	}
	
	suma += sin( ( 360 - sumv ) * atan( 1 ) / 45 );
	
	return suma;

}

int main() {
	
	while ( cin >> M && M ) {
	
		for ( int i = 0; i < M - 1; i++ ) { cin >> VM[i]; }
		cin >> N;
		for ( int i = 0; i < N - 1; i++ ) { cin >> VN[i]; }
		
		double am = area( VM, M );
		double an = area( VN, N );
		
		if ( abs( am - an ) < 1e-8 ) { cout << 0 << endl; }
		else if (am > an) { cout << 1 << endl; }
		else { cout << 2 << endl; }
	
	}
	
}