'use strict'

function main(input) {
  const tmp = input
    .trim()
    .split('\n')
    .map(v => v.split(' ').map(v => parseFloat(v)))
  const n = tmp[0][0]
  const q = tmp[0][1]
  const edges = tmp.slice(1, n)
  const actions = tmp.slice(n, n + q)
  //
  const nodes = [...new Array(n + 1)].map(v => [])
  for (let i = 0; i < n - 1; i++) {
    const p = edges[i][0]
    nodes[p].push(edges[i][1])
  }

  const nodeStack = [...new Array(n + 1)].map(v => [])
  //
  for (let i = 1; i <= n; i++) {
    //
    if (nodes[i].length) {
      let stack = [...nodes[i]]
      while (stack.length) {
        const node = stack.pop()
        nodeStack[i].push(node)
        stack = stack.concat(nodes[node])
      }
    }

    //
  }

  const ans = [...new Array(n + 1)].map(v => 0)
  for (let i = 0; i < q; i++) {
    const act = actions[i]
    const cnt = act[1]
    ans[act[0]] += cnt
    nodeStack[act[0]].map(v => (ans[v] += cnt))
  }
  console.log(ans.slice(1).join(' '))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
