#include<cmath>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){int n;cin>>n;double r,R,a=M_PI/180; double s[2];while(n){s[0]=s[1]=0;rep(j,2){R=0;rep(i,n-1)cin>>r,s[j]+=sin(r*a),R+=r;s[j]+=sin((360-R)*a);cin>>n;}cout<<(s[0]!=s[1]?s[0]>s[1]?1:2:0)<<endl;}return 0;}