N,Q = map(int, input().split())

score = [0 for _ in range(N)]
 
# 子頂点番号:親頂点番号のdictを生成する
d = {}
for i in range(1,N):
  a,b = map(int,input().split())
  d[b] = a
      
# スコア加算処理
for i in range(1,Q+1):
  p,x = map(int,input().split())
  score[p-1] = x  
for i in range(1,len(score)):
  addScore = score[d[i+1]-1]
  score[i] += addScore
print(*score)