#include <iostream>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    int boja;
    for(int i = 1; i <= n; i++)
        cin >> boja;

    for(int i = 1; i < n; i++) {
        int cvor1, cvor2;
        cin >> cvor1 >> cvor2;
    }

    cout << boja[1] << "\n0\n\n0\n";

    return 0;
}