#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <tuple>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <bitset>
#include <list>
#include<iomanip>

using namespace std;
using ll = long long;
using ULL = unsigned long long;
using pll = std::pair<ll, ll>;
using vi = std::vector<int>;
using vl = std::vector<ll>;
using vb = std::vector<bool>;
using db = double;
using vdb = std::vector<db>;
using qlg= std::priority_queue<ll, vl, std::greater<ll> > ; //ascending
using qll= std::priority_queue<ll, vl, std::less<ll> > ; // descending
using qdg= std::priority_queue<db, vdb, std::greater<db> > ; //ascending
using qdl= std::priority_queue<db, vdb, std::less<db> > ; // descending
using tlll = tuple<ll, ll, ll> ;
template<class T>
using vv = std::vector<std::vector<T> >;


#define REPL(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FORL(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define REP(i, n) FORL(i, 0, n)

#define MREP(i, n) for (ll i= (ll)(n)-1; i>=0; i-- )
#define MFOR(i, a, b) for (ll i = (ll)(b)-1; i >= (ll)(a); i--)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rreps(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bit(n) (1LL << (n))
#define INF pow(10, 10)



int main(void)
{
    ll S, P, N, Q;

    cin >>N;
    vector<pll> Edges(N-1);
    vv<ll> Graph(N);
    vl adds(N, 0);
    vl pars(N, -1);
    vl sums(N, 0);

    REP(i, N-1)
    {
        ll a, b;
        cin >> a >> b;
        a --; b --;
        Edges[i] = {a, b};
        Graph[a].push_back(b);
        Graph[b].push_back(a);
    }

    cin >> Q;
    vv<ll> Tasks(Q, vl(3) );
    REP(i, Q)
    {
        ll t, e, x;
        cin >> Tasks[i][0] >> Tasks[i][1] >> Tasks[i][2];
        Tasks[i][1] --;
    }

    queue<ll> Que;
    ll Parent_Tree = 0;
    Que.push(Parent_Tree); // 0を頂点とする木
    vb used(N);
    while( !Que.empty() )
    {
        ll from = Que.front(); Que.pop();
        used[from] = true;
        REP(i, Graph[from].size() )
        {
            ll to = Graph[from][i];
            if(used[to]) continue;
            pars[to] = from;
            Que.push(to);
        }
    }


    REP(i, N)
    {
        used[i] = false;
    }

    REP(i, Q)
    {
        if(Tasks[i][0]==1)
        {
            ll v = Edges[ Tasks[i][1] ].first;
            ll through = Edges[ Tasks[i][1] ].second;

            if(pars[v]==through)
            {
                adds[v] += Tasks[i][2];
            }
            else
            {
                adds[Parent_Tree] += Tasks[i][2];
                adds[through] -= Tasks[i][2];
            }
        }
        else
        {
            ll through = Edges[ Tasks[i][1] ].first;
            ll v = Edges[ Tasks[i][1] ].second;
            if(pars[v]==through)
            {
                adds[v] += Tasks[i][2];
            }
            else
            {
                adds[Parent_Tree] += Tasks[i][2];
                adds[through] -= Tasks[i][2];
            }
        }
    }



    Que.push(Parent_Tree);
    while( !Que.empty() )
    {
        ll from = Que.front(); Que.pop();
        used[from] = true;
        sums[from] += adds[from];
        REP(i, Graph[from].size() )
        {
            ll to = Graph[from][i];
            // if(used[to] == true) continue;
            if(pars[to] != from) continue;
            adds[to] += sums[from];
            Que.push(to);
        }

    }


    REP(i, N)
    {
        cout << sums[i] << endl;
    }


    return 0;
}

#include <bits/stdc++.h>
#define int long long

using namespace std;

int n;
vector <int> num, used, tin, tout, add, dist, num1;
vector <vector <int> > graph, up;
vector <pair <int, int> > smth;
map <int, int> kek;
int timer = 0, res = 0;
const int l = 27;

int dfs(int v, int par) {
    used[v] = 1;
    int size_of_now = 1;
    timer++;
    tin[v] = timer;
    dist[v] = dist[par] + num[v];
    up[v][0] = par;
    for (int i = 1; i < l; i++) up[v][i] = up[up[v][i - 1]][i - 1];
    for (auto to : graph[v]) {
        if (!used[to]) size_of_now += dfs(to, v);
    }
    timer++;
    tout[v] = timer;
    smth.push_back({v, size_of_now});
    kek[v] = n - (int)smth.size();
    return size_of_now;
}

bool check(int a, int b) {
    return (tin[a] <= tin[b] && tout[a] >= tout[b]);
}

int lca(int a, int b) {
    if (check(a, b)) return a;
    if (check(b, a)) return b;
    for (int i = l - 1; i >= 0; i--) {
        if (!check(up[a][i], b)) a = up[a][i];
    }
    return up[a][0];
}

void push(int v) {
    add[v * 2] += add[v];
    add[v * 2 + 1] += add[v];
    add[v] = 0;
}

void upd(int v, int tl, int tr, int l, int r, int k) {
    if (r <= tl || l >= tr) return;
    else if (l <= tl && r >= tr) add[v] += k;
    else {
        int tm = (tl + tr) / 2;
        upd(v * 2, tl, tm, l, r, k);
        upd(v * 2 + 1, tm, tr, l, r, k);
    }
}

int get(int v, int tl, int tr, int pos) {
    if (tl == tr - 1) {
        return add[v];
    }
    else {
        int tm = (tl + tr) / 2;
        if (pos < tm) {
            return add[v] + get(v * 2, tl, tm, pos);
        }
        else {
            return add[v] + get(v * 2 + 1, tm, tr, pos);
        }
    }
}

void upd2(int v, int tl, int tr, int pos) {
    if (tl + 1 == tr) {
        add[v] = 0;
        return;
    }
    else {
        push(v);
        int tm = (tl + tr) / 2;
        if (pos < tm) upd2(v * 2, tl, tm, pos);
        else upd2(v * 2 + 1, tm, tr, pos);
    }
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    num.resize(n);
    used.resize(n);
    tin.resize(n);
    tout.resize(n);
    graph.resize(n);
    up.resize(n);
    add.resize(4 * n);
    dist.resize(n);
    num1.resize(n);
    for (int i = 0; i < n; i++) {
        up[i] = vector <int> (l, 0);
    }
    vector <pair <int, int> > edges;
    for (int i = 0; i < n - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        edges.push_back({a, b});
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    dfs(0, 0);
    reverse(smth.begin(), smth.end());
    int sum = 0;
    int q;
    cin >> q;
    while (q--) {
        int req;
        cin >> req;
        int a, b;
        if (req == 1) {
            int x;
            cin >> x;
            x--;
            a = edges[x].first;
            b = edges[x].second;
        }
        else {
            int x;
            cin >> x;
            x--;
            a = edges[x].first;
            b = edges[x].second;
            swap(b, a);
        }
        int delta;
        cin >> delta;
        if (up[a][0] == b) {
            int pos = kek[a];
            int len = smth[pos].second;
            upd(1, 0, n, pos, pos + len, delta);
        }
        else {
            sum += delta;
            int pos = kek[b];
            int len = smth[pos].second;
            upd(1, 0, n, pos, pos + len, -delta);
        }
    }
    for (int i = 0; i < n; i++) {
        int res = get(1, 0, n, kek[i]) + sum;
        cout << res << "\n";
    }
    return 0;
}
