
N,Q = (int(i) for i in input().split())
hen = {}
value = [0] * N
flag = [0] * N
for i in range(0,N-1):
    a,b = (int(i) for i in input().split())
    if a in hen:
        hen[a].append(b)
    else:
        hen[a] = [b]
#print(hen)

def add(p,x):
    if p in hen:
        for i in hen[p]:
            value[i-1] = value[i-1] + x
            add(i,value[i-1])

for i in range(0,Q):
    p,x = (int(i) for i in input().split())
    value[p-1] = value[p-1] + x


add(1,value[0])
print(' '.join(map(str,value)))
    
