You are given a tree rooted at node $1$ with $N$ vertices. The $i$$th$ vertex initially has value $A_i (1 \leq i \leq N)$. You are also given $Q$ queries. 
In each query you are given a vertex $V$.  Let $S = \{ S_1 , S_2 , ... S_x \} $ denote the set of vertices such that $S_i$ is in the subtree of $V$, distance between $S_i$ and $V$ is even and $S_i \neq V$ for all $i$. For all $S_i$ , add $A$$S_i$ to $A_V$ and change the value of $A$$S_i$ to zero.
Find the values of all the vertices after all queries are performed. 
Note-The distance between two vertices is defined as the number of edges
traversed on the shortest path from one vertex to the other.

-----Input:-----
- The first line contains an integer $T$ denoting the number of test cases.
- The first line of each test case contain two integers $N$ and $Q$.
- The second line contains $N$ space separated integers, $A_1, A_2, ..., A_n$ denoting the initial values of the vertices.
- The next $N-1$ lines contain two integers $u$ and $v$ denoting an edge between $u$and $v$.
- The next $Q$ lines contain a single integer which is the query.

-----Output:-----
- Print a single line containing $N$ integers for each test case which is the final values of the vertices.

-----Constraints:-----
- $1\leq T \leq 10$
- $1 \leq N \leq 200000$
- $1 \leq Q \leq 200000$
- $0 \leq A_i \leq 10^9$
- The sum of $N$ over all test cases does not exceed $200000$.
- The sum of $Q$ over all test cases does not exceed $200000$.

-----Sample Input-----
1
4 3
6 2 7 3
1 2
2 3
3 4
3
2
1

-----Sample Output-----
13 5 0 0

-----Explanation-----
Node $3$ has no child in its subtree which is at  an even distance so there is no change in the values. Values of nodes after $1st$ query: $6, 2, 7, 3$.
Node $4$ is at an even distance in the subtree of node $2$ so $A_4$ gets added to $A_2$ and $A_4$ becomes 0. Values of nodes after $2nd$ query: $6, 5, 7, 0$.
Node $3$ is at an even distance in the subtree of node $1$ so $A_3$ gets added to $A_1$ and $A_3$ becomes 0. Values of nodes after $3rd$ query: $13, 5, 0, 0$.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'from collections import defaultdict as dd,deque as dq\ndef opbfs(u,vis,ll,parr):\n q=dq([(u,0)])\n uu=u\n su=0\n while q:\n  \n  u,lol=q.pop()\n  par=parr[u]\n  if(lol%2==0):\n   vis[u]=1\n   su+=ll[u-1]\n   ll[u-1]=0\n  for j in d[u]:\n   if(j!=par):\n    q.appendleft((j,lol+1))\n ll[uu-1]=su\ndef bfs(height,d,parr):\n q=dq([1])\n while q:\n  u=q.pop()\n  height[u]=height[parr[u]]+1\n  for i in d[u]:\n   if(i!=parr[u]):\n    q.appendleft(i)\n    parr[i]=u\nt=int(input())\nwhile t:\n n,q=map(int,input().split())\n ll=list(map(int,input().split()))\n d=dd(list)\n for i in range(n-1):\n  u,v=map(int,input().split())\n  d[u].append(v)\n  d[v].append(u)\n vis=[0]*(n+1)\n l=[]\n height=[0]*(n+1)\n parr=[0]*(n+1)\n bfs(height,d,parr)\n for i in range(q):\n  u=int(input())\n  l.append((height[u],u,i))\n l.sort()\n vis=[0]*(n+1)\n #print(l)\n for i in l:\n  he,u,ind=i\n  if(vis[u]==0):\n   #print(u)\n   opbfs(u,vis,ll,parr)\n print(*ll)\n t-=1'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14435