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())
a = [0]*N
b = [0]*N
for i in range(N-1):
  a[i], b[i] = map(int, input().split())
p = [0]*Q
x = [0]*Q
for i in range(Q):
  p[i], x[i] = map(int, input().split())

ans = [0]*N  
L = []
L2 = [[0] for _ in range(N)]

for i in range(N-1):
  route = []
  if b[i] not in a:
    route.append(b[i])
    var = a[i]
    while True:
      if var in b:
        route.append(var)
        var = a[b.index(var)]
      else:
        route.append(int(1))
        break
  if len(route) > 0:
    L.append(route)
  
for i in range(len(L)):
  for j in range(len(L[i])):
    while(j >= 1):
      L2[L[i][j]].append(L[i][j-1])
      j -= 1
print(L2)
      
for i in range(Q):
  if p[i] in a:
    var = 0
  else:
    ans[i] += x[i]


print(*ans)
n,q = map(int,input().split())
peer = [[] for _ in range(n)]
for _ in range(n-1):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  peer[a].append(b)
  peer[b].append(a)
ans = [0 for _ in range(n)]
for _ in range(q):
  p,x = map(int,input().split())
  p -= 1
  ans[p] += x
ect = [0 for _ in range(n)]
ect[0] = 1
now = [0]
while now != []:
  last = now
  now = []
  for x in last:
    for y in peer[x]:
      if ect[y] == 0:
        ect[y] = 1
        now.append(y)
        ans[y] += ans[x]
print(' '.join(list(map(str,ans))))
