The input contains multiple test cases.
For each test case, the first line contains one positive integers $n$, indicating the number of node. $(2 \leq n \leq 200000)$
Next line contains $n$ integers where the $i$-th integer represents $c_i$, the color of node $i$. $(1 \leq c_i \leq n)$
Each of the next $n - 1$ lines contains two positive integers $x, y$ $(1 \leq x, y \leq n, x \neq y)$, meaning an edge between node $x$ and node $y$.
It is guaranteed that these edges form a tree.