The input contains multiple test cases. There are about 30 test cases.
Each test case begin with an integer n.
next line contains n integers $A_{1},A_{2}\cdots A_{n}$.
next line contains n-1 integers $P_{2},P_{3}\cdots P_{n}. P_{i}$ indicates the direct supervisor of i.
$1 \leq n \leq 100000$
$1 \leq A_{i} \leq 100000$
$1 \leq P_{i} < i$