#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char const* argv[])
{
	int m;
	double naikaku;
	double theta;
	double S1,S2;

	while( cin >> m && m != 0 ){
		S1 = S2 = 0;
		naikaku = 360;
		for( int i = 0;i < m - 1;i++ ){
			cin >> theta;
			naikaku -= theta;
			theta *= 3.14159265 / 180;
			S1 += sin( theta ) / 2;
		}
		S1 += sin( naikaku * 3.14159265 / 180 ) / 2;

		cin >> m;
		naikaku = 360; 
		for( int i = 0;i < m - 1;i++ ){
			cin >> theta;
			naikaku -= theta;
			theta *= 3.14159265 / 180;
			S2 += sin( theta ) / 2;
		}
		S2 += sin( naikaku *  3.14159265 / 180 ) / 2;

		if( S1 == S2 ) cout << 0 << endl;
		else if( S1 > S2 ) cout << 1 << endl;
		else if( S1 < S2 ) cout << 2 << endl;
	}
	return 0;
}