Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.
N,Q = map(int,input().split())
scores = [0 for _ in range(N)]
flags = [1 for _ in range(N)]

tree = [[] for _ in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

for _ in range(Q):
    p,x = map(int,input().split())
    scores[p-1] += x

from collections import deque
nextp = deque([0])
flags[0] = 0
while nextp:
    p = nextp.pop()
    for t in tree[p]:
        if flags[t]:
            scores[t] += scores[p]
            flags[t] = 0
            nextp.append(t)

N,Q = map(int,input().split())
scores = [0 for _ in range(N)]
flags = [1 for _ in range(N)]

tree = [[] for _ in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

for _ in range(Q):
    p,x = map(int,input().split())
    scores[p-1] += x

from collections import deque
nextp = deque([0])
flags[0] = 0
while nextp:
    p = nextp.pop()
    for t in tree[p]:
        if flags[t]:
            scores[t] += scores[p]
            flags[t] = 0
            nextp.append(t)
print(*scores)