The first line contains the number of vertices N (1≤N≤100000).
The second line contains N−1 integers p0,p1,…,pN−2 (0≤pi≤i). This means there is an edge between vertex pk and vertex k+1.
The third line contains N integers x0,x1,…,xN−1 giving the color of each vertex. If xi is 0, vertex i is white; if it is 1, vertex i is black.