num_nodes, num_ops = gets.split(' ').map(&:to_i)
$nodes = Array.new(num_nodes){ 0 }
$paths = Array.new(num_nodes - 1){ gets.split(' ').map(&:to_i) }
def path_direction(paths, roots)
  parents = paths.find_all{|p| roots.include?(p[0]) }
  parents += paths.find_all{|p| roots.include?(p[1]) }.map{|p| p.reverse! }
  children = paths - parents
  if children.length > 0
  	parents + path_direction(children, parents.map{|p| p[1] })
  else
    parents
  end
end
$paths = path_direction($paths, [1])

num_ops.times do
  i, x = gets.split(' ').map(&:to_i)
  $nodes[i-1] += x
end

def travel(i, n=0)
  $nodes[i-1] += n
  n = $nodes[i-1]
  children = $paths.find_all{|p| p[0] == i }.map{|p| p[1] }
  children.each{|j| travel(j, n) }
end

travel(1)
puts($nodes.join(' '))