let [|n;q|] = stdin.ReadLine().Split() |> Array.map int
let ab = List.init (n-1) (fun _ -> stdin.ReadLine().Split() |> Array.map int |> (fun [|a;b|]->(a,b)))
let px = List.init q (fun _ -> stdin.ReadLine().Split() |> Array.map int |> (fun [|a;b|]->(a,b)))

let (arr:int list[]) = Array.create n []
let arr_2 = Array.create n 0
let arr_3 = Array.create n 0

for i in 0..n-2 do
 match ab.[i] with
 | (a,b) -> arr.[a-1] <- (b-1) :: arr.[a-1]

for i in 0..q-1 do
 match px.[i] with
 | (p,x) -> arr_2.[p-1] <- arr_2.[p-1] + x

for i in 0..n-1 do
 arr_3.[i] <- arr_3.[i] + arr_2.[i]
 let rec f i array =
  match array with
  | [] -> ()
  | hd :: tl -> arr_3.[hd] <- arr_3.[hd] + arr_3.[i]
                f i tl
 f i arr.[i]

for i in 0..n-1 do
 arr_3.[i] |> stdout.Write
 stdout.Write " "