//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>
#include <locale>
#include <random>
#include <type_traits>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

using LL = long long;

//------------------------------------------
//------------------------------------------

constexpr LL MAX_N = 200020;
vector<int> G[MAX_N];

void euler_func(int v, int p, int &euler_k, vector<int> &euler_in, vector<int> &euler_out, vector<int> &euler_tour) {
    euler_in[v] = euler_k++;
    euler_tour.push_back(v);
    for (auto to: G[v]) {
        if (to != p) {
            euler_func(to, v, euler_k, euler_in, euler_out, euler_tour);
            euler_tour.push_back(v);
        }
    }
    euler_out[v] = euler_k++;
}

template<typename T>
struct LazySegmentTree {

private:
    int n;
    T init_v;
    vector<T> node;
    vector<T> lazy;

public:
    LazySegmentTree(vector<T> a, T _init_v) {

        n = 1;
        init_v = _init_v;

        int sz = a.size();
        while (n < sz) n *= 2;

        node.resize(2 * n, init_v);
        lazy.resize(2 * n, init_v);

        for (int i = 0; i < sz; i++) node[i + n - 1] = a[i];
        for (int i = n - 2; i >= 0; i--) node[i] = node[i * 2 + 1] + node[i * 2 + 2];
    }

    void eval(int k, int l, int r) {
        if (lazy[k] != 0) {
            node[k] += lazy[k];
            if (r - l > 1) {
                lazy[k * 2 + 1] += lazy[k] / 2;
                lazy[k * 2 + 2] += lazy[k] / 2;
            }
            lazy[k] = 0;
        }
    }

    void add(int a, int b, T x, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = n;
        eval(k, l, r);
        if (r <= a || b <= l) return;
        if (a <= l && r <= b) {
            lazy[k] += (r - l) * x;
            eval(k, l, r);
        } else {
            add(a, b, x, k * 2 + 1, l, (l + r) / 2);
            add(a, b, x, k * 2 + 2, (l + r) / 2, r);
            node[k] = node[k * 2 + 1] + node[k * 2 + 2];
        }
    }

    T getsum(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = n;
        eval(k, l, r);
        if (r <= a || b <= l) return 0;
        if (a <= l && r <= b) return node[k];
        T lv = getsum(a, b, k * 2 + 1, l, (l + r) / 2);
        T rv = getsum(a, b, k * 2 + 2, (l + r) / 2, r);
        return lv + rv;
    }

};

int main() {

    int N, Q;
    cin >> N >> Q;

    for (int i = 0; i < N - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    int euler_k = 0;
    vector<int> euler_in(N), euler_out(N), euler_tour;
    euler_func(0, -1, euler_k, euler_in, euler_out, euler_tour);

    LazySegmentTree<LL> tree(vector<LL>(2 * N, 0), 0);

    for (int i = 0; i < Q; i++) {
        LL p, x;
        cin >> p >> x;
        p--;
        tree.add(euler_in[p], euler_out[p] + 1, x);
    }

    for (int i = 0; i < N; i++) {
        cout << tree.getsum(euler_in[i], euler_in[i] + 1) << " ";
    }

}
























Measured memory_bytes: 49524