#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using ll = long long;
const int INF = 2147483647;
using namespace std;
int ggd(int number1, int number2) {
  int m = number1;
  int n = number2;
  if (number2 > number1) {
    m = number2;
    n = number1;
  }
  while (m != n) {
    int temp = n;
    n = m - n;
    m = temp;
  }
  return m;
}
int lcm(int number1, int number2) {
  return number1 * number2 / ggd(number1, number2);
}
bool is_prime(int64_t x) {
  for (int64_t i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
vector<ll> countup(vector<ll> count, vector<pair<int, int>> graph, int p, int x,
                   int n) {
  for (int j = 0; j < (n - 1); ++j) {
    if (graph[j].first == p) {
      count[graph[j].second - 1] += x;
      count = countup(count, graph, graph[j].second, x, n);
    }
  }
  return count;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  vector<ll> count(n + 10);
  vector<pair<int, int>> graph(n + 10);
  for (int i = 0; i < (n - 1); ++i) {
    scanf("%d%d", &graph[i].first, &graph[i].second);
    count[i] = 0;
  }
  int p, x;
  for (int i = 0; i < (q); ++i) {
    scanf("%d%d", &p, &x);
    count[p - 1] += x;
    count = countup(count, graph, p, x, n);
  }
  for (int i = 0; i < (n); ++i) printf("%d ", count[i]);
  return 0;
}
