import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array, std.functional;

struct Node {
  int[] children;
  int cnt;
}

void main() {
  auto input = readln.split.to!(int[]);
  auto N = input[0], Q = input[1];
  auto tree = new Node[N];
  foreach(i; 0..(N-1)) {
    input = readln.split.to!(int[]);
    auto a = input[0], b = input[1];
    tree[a-1].children ~= b;
  }

  void add(int p, int x) {
    tree[p-1].cnt+=x;

    foreach(c; tree[p-1].children) {
      add(c, x);
    }
  }

  foreach(i; 0..Q) {
    input = readln.split.to!(int[]);
    auto p = input[0], x = input[1];
    add(p, x);
  }

  foreach(i; 0..N) {
    write(tree[i].cnt, " ");
  }
  writeln;
}
