#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
long long a[1000001];
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    long long n, i, m, s, jedan = 0, dva = 0, br = 0, br1 = 0, br2 = 0, ag;
    cin >> n;
    for (i = 1; i <= n; i++)
    {
        cin >> a[i];
        if (i % 3 == 1)
        {
            jedan += a[i];
            ag = 1;
        }
        else if (i % 3 == 2)
        {
            dva += a[i];
            ag = 2;
        }
        else ag = 3;
    }
    for (i = 0; i < n-1; i++)
    {
        cin >> m >> s;
    }
    cout << 0 << endl;
    return 0;
}