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())

Cnt = [0 for i in range(N)]
Par = [int(i) for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    Par[b-1] = a
for i in range(Q):
    p,x = map(int,input().split())
    Cnt[p-1] += x

for i in range(1,N):
    Cnt[i] += Cnt[Par[i]-1]

for i in range(N):
    print(Cnt[i],end =' ')
import collections
N,Q = map(int,input().split())

Cnt = [0 for i in range(N+1)]
G = [[] for i in range(N+1)]
for i in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a) 
for i in range(Q):
    p,x = map(int,input().split())
    Cnt[p] += x

q = collections.deque()
q.append(1)
flag = [False for i in range(N+1)]
while q:
    v = q.pop()
    flag[v] = True
    for i in G[v]:
        if flag[i]:
            continue
        Cnt[i] += Cnt[v]
        q.append(i)

print(*Cnt[1:])