Magic boy Bi Luo with his excited tree (树形dp）

Bi Luo is a magic boy, he also has a migic tree, the tree has NN nodes , in each node , there is a treasure, it's value is V[i]V[i], and for each edge, there is a cost C[i]C[i], which means every time you pass the edge ii , you need to pay C[i]C[i].

You may attention that every V[i]V[i] can be taken only once, but for some C[i]C[i] , you may cost severial times.

Now, Bi Luo define ans[i]ans[i] as the most value can Bi Luo gets if Bi Luo starts at node ii.

Bi Luo is also an excited boy, now he wants to know every ans[i]ans[i], can you help him?

InputFirst line is a positive integer T(T≤104)T(T≤104) , represents there are TT test cases.

Four each test：

The first line contain an integer NN(N≤105)(N≤105).

The next line contains NN integers V[i]V[i], which means the treasure’s value of node i(1≤V[i]≤104)i(1≤V[i]≤104).

For the next N−1N−1 lines, each contains three integers u,v,cu,v,c , which means node uuand node vv are connected by an edge, it's cost is c(1≤c≤104)c(1≤c≤104).

You can assume that the sum of NN will not exceed 106106.OutputFor the i-th test case , first output Case #i: in a single line , then output NNlines , for the i-th line , output ans[i]ans[i] in a single line.Sample Input