#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define ll long long
#define int long long
#define pb push_back
#define x first
#define ld long double
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) a.begin(),a.end()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int N = 2e5 + 11;
vector <int> edge[N];
int timer = 0, tin[N] = {}, tout[N] = {}, pr[N] = {}, a[N] = {};
bool used[N] = {};
inline void dfs (int v, int p = 0) {
    used[v] = true;
    tin[v] = timer++;
    pr[v] = p;
    for (auto &i : edge[v]) {
        if (!used[i]) dfs(i, v);
    }
    tout[v] = timer;
}
int t[4 * N] = {}, prom[4 * N] = {};
inline void push (int v, int tl, int tr) {
    if (tl != tr && prom[v]) {
        t[v + v] += prom[v];
        t[v + v + 1] += prom[v];
        prom[v + v] += prom[v];
        prom[v + v + 1] += prom[v];
        prom[v] = 0;
    }
}
inline int get_ans (int v, int tl, int tr, int l, int r) {
    push(v, tl, tr);
    if (l > r) rr;
    if (tl == l && tr == r) return t[v];
    int tm = (tl + tr) >> 1;
    return get_ans(v + v, tl, tm, l, min(r, tm)) + get_ans(v + v + 1, tm + 1, tr, max(tm + 1, l), r);
}
inline void update (int v, int tl, int tr, int l, int r, int val) {
    push(v, tl, tr);
    if (l > r) return;
    if (tl == l && tr == r) {
        t[v] += val;
        prom[v] += val;
    }
    else {
        int tm = (tl + tr) >> 1;
        update(v + v, tl, tm, l, min(r, tm), val);
        update(v + v + 1, tm + 1, tr, max(tm + 1, l), r, val);
        t[v] = t[v + v] + t[v + v + 1];
    }
}
//inline void build (int v, int tl, int tr) {
//    if (tl == tr) {
//        t[v] = a[tl];
//    }
//    else {
//        int tm = (tl + tr) >> 1;
//        build(v + v, tl, tm);
//        build(v + v + 1, tm + 1, tr);
//        t[v] = t[v + v] + t[v + v + 1];
//    }
//}
main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m, v, u;
    cin >> n >> m;
    for (int i = 1; i < n; i++) {
        cin >> u >> v;
        --v, --u;
        edge[u].pb(v);
        edge[v].pb(u);
    }
    dfs(0);
    int t, val;
    while (m--) {
        cin >> v;
        --v;
        cin >> val;
        update(1, 0, timer, tin[v], tout[v] - 1, val);
    }
    for (int i = 0; i < n; i++) {
        cout << get_ans(1, 0, timer, tin[i], tin[i]) << ' ';
    }
}


Measured memory_bytes: 37504