#include using namespace std; void solve(); int main(){cin.tie(0); ios::sync_with_stdio(false); cout<; using pld=pair; #define fi first #define se second #define SELECTOR(_1,_2,_3,SELECT,...) SELECT #define rep(...) SELECTOR(__VA_ARGS__,_rep1,_rep0)(__VA_ARGS__) #define _rep0(i,n) for(ll i=0;i void vecout(const T &v){for(auto it=v.begin();it!=v.end();++it,cout<<(it!=v.end()?" ":"\n"))cout<<*it;} template class SegmentTree{ using F=function; using G=function; using H=function; private: ll n=1; F dot; T e; G comp; E id; H act; vector node; vector lazy; constexpr inline void propagate(ll i){ if(lazy[i]==id) return; if(i<=n-1){ lazy[2*i]=comp(lazy[2*i],lazy[i]); lazy[2*i+1]=comp(lazy[2*i+1],lazy[i]); } node[i]=act(lazy[i],node[i]); lazy[i]=id; } void ancestors_propagate(ll i){ if(i==1) return; ancestors_propagate(i>>=1); propagate(i); } constexpr inline void update_ancestors(ll i){ while(i!=1){ propagate(i+1-2*(i%2)); i>>=1; node[i]=dot(node[2*i],node[2*i+1]); } } public: constexpr SegmentTree(const vector &A,F dot,T e,G comp,E id,H act) :dot(dot),e(e),comp(comp),id(id),act(act){ while(n0;--i) node[i]=dot(node[2*i],node[2*i+1]); } constexpr void update(ll i,T c){ ancestors_propagate(i+=n); propagate(i); node[i]=c; update_ancestors(i); } constexpr void add(ll l,ll r,E f){ vector range,low(2); for(l+=n,r+=n;l>=1,r>>=1){ if(l%2==1){ if(!low[0]) low[0]=l; range.push_back(l++); } if(r%2==1){ range.push_back(--r); if(!low[1]) low[1]=r; } } for(ll i:low) if(i) ancestors_propagate(i); for(ll i:range) lazy[i]=comp(lazy[i],f); for(ll i:low) if(i){ propagate(i); update_ancestors(i); } } constexpr T sum(ll l,ll r){ T vl=e, vr=e; pair low; for(l+=n,r+=n;l>=1,r>>=1){ if(l%2==1){ if(!low.first){ ancestors_propagate(l); low.first=true; } propagate(l); vl=dot(vl,node[l]); l++; } if(r%2==1){ r--; if(!low.second){ ancestors_propagate(r); low.second=true; } propagate(r); vr=dot(node[r],vr); } } return dot(vl,vr); } }; class EulerTour{ private: ll m_n; vector> E; vector m_begin,m_end; vector m_tour; ll i=0; void dfs(ll v,ll p){ m_begin[v]=i; for(const pll& u:E[v]){ if(u.fi==p) continue; m_tour[i++]=make_pair(u.se,1); dfs(u.fi,v); m_tour[i++]=make_pair(-u.se,-1); } m_end[v]=i; } public: EulerTour(const vector>& E,ll root=0):E(E){ m_n=E.size(); m_begin.resize(m_n); m_end.resize(m_n); m_tour.resize(2*m_n-2); dfs(root,-1); } const vector& begin(){return m_begin;} const vector& end(){return m_end;} const vector& tour(){return m_tour;} }; void solve(){ ll n; cin>>n; vector> E(n); rep(_,n-1){ ll u,v,w; cin>>u>>v>>w; E[u].emplace_back(v,w); } // build auto tour=EulerTour{E}; auto dot=[](pll a,pll b){return make_pair(a.fi+b.fi,a.se+b.se);}; pll e=make_pair(0,0); auto comp=[](ll f,ll g){return g+f;}; ll id=0; auto act=[](ll f,pll a){return make_pair(a.fi+f*a.se,a.se);}; auto tree=SegmentTree(tour.tour(),dot,e,comp,id,act); // query ll q; cin>>q; rep(_,q){ ll c; cin>>c; if(c==1){ ll a,x; cin>>a>>x; tree.add(tour.begin()[a],tour.end()[a]-1,x); } else { ll b; cin>>b; cout<