import scala.io.StdIn._
import scala.collection.mutable.ArrayBuffer
object Main extends App {
  val Array(n, q) = readLine.split(" ").map(_.toInt)

  val edges: Array[ArrayBuffer[Int]] = Array.tabulate(n)(_ => new ArrayBuffer[Int]())
  (1 to n - 1).foreach {i =>
    val Array(a, b) = readLine.split(" ").map(_.toInt)
    edges(a) += b
  }

  val vs = new Array[Long](n + 1)
  (1 to q).foreach {i =>
    val Array(p, x) = readLine.split(" ").map(_.toInt)
    vs(p) += x
  }

  (1 to n - 1).foreach {i =>
    edges(i).foreach {v => vs(v) += vs(i)}
  }

  println(vs.tail.mkString(" "))
}