#include <iostream>
#include <string>
#include <math.h>
#include <map>
#include <algorithm>
#include <vector>
#include <fstream>
#include <set>
#include <unordered_map>
#include <queue>
#include <chrono>
#include <climits>
#include <stack>
using namespace std;
using namespace std::chrono;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define S second
#define F first
//#define A 999999999999999999LL
#define M 1000000007
#define N 202020
#define REDIR \
ifstream in("input.txt"); \
cin.rdbuf(in.rdbuf());
int reitti1[10];
int reitti2[10];
int main() {
for (size_t i = 0; i < 10; i++)
{
cin >> reitti1[i];
}
for (size_t i = 0; i < 10; i++)
{
cin >> reitti2[i];
}
int nousua1 = 0;
int nousua2 = 0;
int last1 = 0;
int last2 = 0;
for (size_t i = 0; i < 10; i++)
{
int r1 = reitti1[i];
if (r1 > last1) nousua1 += r1 - last1;
last1 = r1;
int r2 = reitti2[i];
if (r2 > last2) nousua2 += r2 - last2;
last2 = r2;
}
if (nousua1 < nousua2) {
cout << 1 << endl;
} else {
cout << 2 << endl;
}