#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int m;
    while (cin >> m, m) {
        double a1 = 0;
        int v_sum = 0;
        for (int i = 0; i < m-1; i++) {
            int v;
            cin >> v;
            a1 += sin(M_PI * v / 180.0);
            v_sum += v;
        }
        a1 += sin(M_PI * (360 - v_sum) / 180.0);
        int n;
        cin >> n;
        double a2 = 0;
        v_sum = 0;
        for (int i = 0; i < n-1; i++) {
            int v;
            cin >> v;
            a2 += sin(M_PI * v / 180.0);
            v_sum += v;
        }
        a2 += sin(M_PI * (360 - v_sum) / 180.0);
        int ans = 0;
        if (a1 > a2) {
            ans = 1;
        } else if (a1 < a2) {
            ans = 2;
        }
        cout << ans << endl;
    }
}