#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include using namespace std; using ll = long long; #define all(p) p.begin(),p.end() #define rep(i,a,b) for(int i=(int)a;i<(int)b;i++) const int mod=998244353; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,Q; cin>>N>>Q; vector A(N-1),B(N-1); vector C(N-1); vector> G(N); rep(i,0,N-1){ cin>>A[i]>>B[i]>>C[i]; A[i]--,B[i]--; G[A[i]].push_back(B[i]); G[B[i]].push_back(A[i]); } vector order={0},depth(N),wei(N),pare(N,-1); pare[0]=-2; rep(i,0,N){ int a=order[i]; for(auto b:G[a]){ if(pare[b]==-1){ pare[b]=a; order.push_back(b); depth[b]=depth[a]+1; } } } rep(i,0,N){ int a=order[N-i-1]; for(auto b:G[a]){ if(pare[b]==a) wei[a]+=wei[b]; } wei[a]++; } vector n_C(N),V(N); rep(i,0,N-1){ if(depth[A[i]]>depth[B[i]]) swap(A[i],B[i]); n_C[B[i]]=C[i]; } swap(n_C,C); rep(rp,0,Q){ int t; cin>>t; if(t==1){ int u; ll x; cin>>u>>x; u--; while(u){ V[u]+=x; if(C[u]<=V[u]){ int tmp=u; while(u){ u=pare[u]; V[u]+=x; V[u]-=V[tmp]; wei[u]-=wei[tmp]; } break; } u=pare[u]; } } if(t==2){ cout<