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

tree = Array.new
1.upto(n-1) do |i|
  ai, bi = gets.split.map(&:to_i)
  tree[bi] = ai
end

points = Array.new(n + 1, 0)
1.upto(q) do |i|
  pi, xi = gets.split.map(&:to_i)
  points[pi] += xi
end

2.upto(n) do |node_n|
  points[node_n] += points[tree[node_n]]
end

points.shift
puts "#{points.join(" ")}\n"
