Time Limit: 2000 ms
Memory Limit: 131072kb
First line of input contains one integer T which indicates the number of test cases .
The first line of each test case contains one integer N .
Followed by 1 line with N integers representing A , A , … , A[N] .
Then N-1 lines follow . The i-th of these lines contains 2 integers u and v , denoting one edge between u and v . It is guaranteed that the input data forms a tree .
The next line contains 1 integer Q , the number of queries .
Each of the next Q lines contain 1 integer u described as above .
1 ≤ T ≤ 5
1 ≤ N, Q ≤ 1e5
1 ≤ A[node] ≤ 1e5