#include <iostream>
#include <cmath>

typedef long double ld;

int main()
{
	int m, n;
	while (true) {
		std::cin >> m;
		if (m==0) break;
		int deg_total = 0;
		ld area1 = 0.0;
		for (int i=0; i<m-1; i++) {
			int d; std::cin >> d;
			deg_total += d;
			area1 += std::sin((ld)d * M_PI / 180.0);
		}
		area1 += std::sin((ld)(360-deg_total) * M_PI / 180.0);
		std::cin >> n;
		deg_total = 0;
		ld area2 = 0.0;
		for (int i=0; i<n-1; i++) {
			int d; std::cin >> d;
			deg_total += d;
			area2 += std::sin((ld)d * M_PI / 180.0);
		}
		area2 += std::sin((ld)(360-deg_total) * M_PI / 180.0);
		if (area1 > area2) std::cout << 1 << std::endl;
		else if (area1 < area2) std::cout << 2 << std::endl;
		else std::cout << 0 << std::endl;
	}
	return 0;
}

