#include <iostream>
#include <math.h>

using namespace std;

const double PI = 3.14159265;

int n;
int angle[360];

int main(int argc, char** argv)
{
	double osum;
	while(cin >> n, n)
	{
		int last =360;
		for(int i=0; i<n-1; i++)
		{
			cin >> angle[i];
			last -= angle[i];
		}
		angle[n-1] = last;
		
		double sum = 0.0;
		for(int i=0; i<n; i++)
		{
			sum += sin(2.0 * angle[i] * PI / 360.0) / 2.0;
		}
		
		if(osum != 0.0)
		{
			if(osum > sum) cout << 1 << endl;
			else if(osum < sum) cout << 2 << endl;
			else cout << 0 << endl;
			osum = 0.0;
		}
		else
		{
			osum = sum;
		}
	}
}