The first line contains an integer
N(1≤N≤2×106), representing the number of nodes of the city Eezie lives in.
Each of the next
N−1 lines contains two integers
u,v(1≤u,v≤N)u, representing an edge. It is guaranteed that the edges form a tree.
The last line contains N integers d1,d2,⋯,dN(0≤di≤N), representing the maximum travel distances for pies from pie houses.