#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;


template<typename Monoid ,typename OperatorMonoid=Monoid>
struct LazySegmentTree{
  using F=function<Monoid(Monoid,Monoid)>;
  using G=function<Monoid(Monoid,OperatorMonoid)>;
  using H=function<Monoid(OperatorMonoid,OperatorMonoid)>;
  int sz,height;
  vector<Monoid>data;
  vector<OperatorMonoid>lazy;
  const F f;
  const G g;
  const H h;
  const Monoid M1;
  const OperatorMonoid OM0;

  LazySegmentTree(int n,const F f,const G g,const H h,
                  const Monoid M1,const OperatorMonoid OM0)
    :f(f),g(g),h(h),M1(M1),OM0(OM0){
    sz=1;
    height=0;
    while(sz < n) sz <<= 1, height++;
    data.assign(2 * sz, M1);
    lazy.assign(2 * sz, OM0);
  }
  inline void propagate(int k){
    if(lazy[k]!=OM0){
      lazy[2*k+0]=h(lazy[2*k+0],lazy[k]);
      lazy[2*k+1]=h(lazy[2*k+1],lazy[k]);
      data[k]=reflect(k);
      lazy[k]=OM0;
    }
  }
  inline Monoid reflect(int k) {
    return lazy[k] == OM0 ? data[k] : g(data[k], lazy[k]);
  }
  inline void recalc(int k) {
    while(k >>= 1) data[k] = f(reflect(2 * k + 0), reflect(2 * k + 1));
  }
  inline void thrust(int k){
    for(int i=height;i>0;i--)propagate(k>>i);
  }
  void update(int a,int b,const OperatorMonoid &x){
    thrust(a+=sz);
    thrust(b+=sz-1);
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) lazy[l] = h(lazy[l], x), ++l;
      if(r & 1) --r, lazy[r] = h(lazy[r], x);
    }
    recalc(a);
    recalc(b);
  }
  Monoid query(int a, int b) {
    thrust(a += sz);
    thrust(b += sz - 1);
    Monoid L = M1, R = M1;
    for(int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
      if(l & 1) L = f(L, reflect(l++));
      if(r & 1) R = f(reflect(--r), R);
    }
    return f(L, R);
  }
  Monoid operator[](const int &k) {
    return query(k, k + 1);
  }
};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n,q;cin>>n>>q;
  vector<vector<ll>>ed(n);
  rep(i,n-1){
    ll a,b;cin>>a>>b;
    a--;b--;
    ed[a].push_back(b);
    ed[b].push_back(a);
  }
  vector<ll>ls(n),rs(n),e;
  function<void(ll,ll,ll&)>dfs=[&](ll v,ll p,ll& idx){
    ls[v]=idx++;
    for(int u:ed[v]){
      if(u==p)continue;
      dfs(u,v,idx);
    }
    rs[v]=idx;
  };
  ll id=0;
  dfs(0,-1,id);
  LazySegmentTree<ll>st(n+1,[](ll a,ll b){return a+b;}
                          ,[](ll a,ll b){return a+b;}
                          ,[](ll a,ll b){return a+b;}
                          ,0,0);
  rep(i,q){
    ll p,x;cin>>p>>x;p--;

    st.update(ls[p],rs[p],x);

  }
  rep(i,n){
    cout<<st.query(ls[i],ls[i]+1)<<" ";
  }
  cout<<endl;
  return 0;

}


Measured memory_bytes: 40320