// NOTE: it is recommended to use this even if you don't understand the
// following code.

#include <fstream>
#include <iostream>
#include <vector>

using namespace std;

// input data
int N;
vector<int> C;
vector<int> P;

int main() {
    //  uncomment the following lines if you want to read/write from files
    //  ifstream cin("input.txt");
    //  ofstream cout("output.txt");

    cin >> N;
    C.resize(N);
    P.resize(N);
    for (int i = 0; i < N; i++) {
        // node i has color C[i]
        cin >> C[i];
    }
    for (int i = 1; i < N; i++) {
        // there is a link P[i] -> i
        // note: P[0] is undefined!
        cin >> P[i];
    }

    // insert your code here

    cout << 42 << endl; // print the result
    return 0;
}
