#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#define EPS (1e-10)
#define PI 3.14159265358979323846264
using namespace std;
 
double rad(double d)
{
  return d*(PI/180.0);
}

int main()
{
  int m;
  while(cin >> m,m)
    {
      double v,areaA,areaB;
      areaA = areaB = 0;
      double ano = 360;
      for(int i=0;i<m-1;i++)
	{
	  cin >> v;
	  areaA += sin(rad(v));
	  ano -= v;
	}
      areaA += sin(rad(ano));
 
      cin >> m;
      ano = 360;
      for(int i=0;i<m-1;i++)
	{
	  cin >> v;
	  areaB += sin(rad(v));
	  ano -= v;
	}
      areaB += sin(rad(ano));
            

      if(fabs(areaA-areaB) <= EPS)
	cout << 0 << endl;
      else if(areaA > areaB)
	cout << 1 << endl;
      else 
	cout << 2 << endl;
      
    }
  return 0;
}