n, q = gets.split(' ').map(&:to_i)

class Node
  attr_accessor :v, :children
  def initialize(v)
    @v = v
    @children = []
  end
end

$nodes = [nil]
$scores = [nil]
n.times do |i|
  node = Node.new(i + 1)
  $nodes << node
  $scores << 0
end

(n-1).times do
  a, b = gets.split(' ').map(&:to_i)
  $nodes[a].children << b
end

def visit(p, x)
  node = $nodes[p]
  $scores[p] += x
  node.children.each do |c|
    visit(c, x)
  end
end

q.times do
  p, x = gets.split(' ').map(&:to_i)
  visit(p, x)
end

puts $scores[1..-1].map(&:to_s).join(" ")
