#include<bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<n;i++)
#define ll long long
using namespace std;
#define MAX 100011
ll upd[MAX],val[MAX];
vector <ll> parent(MAX);
vector <set<ll> > child(MAX);
ll cost(ll node, ll sofar,ll curr)
{
if(node==0)
return curr;
ll ret=val[node]+curr;
if(upd[node]>0)
{
ret+=upd[node]*sofar;
//Push update value to val and children
val[node]+=upd[node];
for(auto it = child[node].begin();it!=child[node].end();it++)
upd[*it]+=upd[node];
upd[node] = 0;
}
return cost(parent[node],sofar+1,ret);
}
int main()
{
ios_base::sync_with_stdio(0);
std::cin.tie(nullptr);
ll n,m,a,x,y;
cin>>n>>m;
REP(i,n-1)
{
cin>>x>>y;
child[x].insert(y);
parent[y] = x;
}
parent[1]=0;
REP(i,m)
{
// cout<<"Query: "<<i+1<<": \n";
cin>>a;
assert(a==2 || a==1);
if(a==1)
{
cin>>x>>y;
upd[x]+=y;
}
else
{
cin>>y;
cout<<cost(y,1,0)<<endl;
}
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBSRVAoaSxuKSAgICAgICAgZm9yKGxsIGk9MDtpPG47aSsrKQojZGVmaW5lIGxsICAgICAgICAgICAgICBsb25nIGxvbmcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBNQVggICAgICAgICAgICAxMDAwMTEKCmxsIHVwZFtNQVhdLHZhbFtNQVhdOwp2ZWN0b3IgPGxsPiBwYXJlbnQoTUFYKTsKdmVjdG9yIDxzZXQ8bGw+ID4gY2hpbGQoTUFYKTsKCgpsbCBjb3N0KGxsIG5vZGUsIGxsIHNvZmFyLGxsIGN1cnIpCnsKICAgIGlmKG5vZGU9PTApCiAgICAgICAgcmV0dXJuIGN1cnI7CgogICAgbGwgcmV0PXZhbFtub2RlXStjdXJyOwoKICAgIGlmKHVwZFtub2RlXT4wKQogICAgewogICAgICAgIHJldCs9dXBkW25vZGVdKnNvZmFyOwoKICAgICAgICAvL1B1c2ggdXBkYXRlIHZhbHVlIHRvIHZhbCBhbmQgY2hpbGRyZW4KICAgICAgICB2YWxbbm9kZV0rPXVwZFtub2RlXTsKICAgICAgICBmb3IoYXV0byBpdCA9IGNoaWxkW25vZGVdLmJlZ2luKCk7aXQhPWNoaWxkW25vZGVdLmVuZCgpO2l0KyspCiAgICAgICAgICAgIHVwZFsqaXRdKz11cGRbbm9kZV07CiAgICAgICAgdXBkW25vZGVdID0gMDsKICAgIH0KCiAgICByZXR1cm4gY29zdChwYXJlbnRbbm9kZV0sc29mYXIrMSxyZXQpOwp9CgppbnQgbWFpbigpCnsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CiAgICBzdGQ6OmNpbi50aWUobnVsbHB0cik7CiAgICBsbCBuLG0sYSx4LHk7CiAgICBjaW4+Pm4+Pm07CiAgICBSRVAoaSxuLTEpCiAgICB7CiAgICAgICAgY2luPj54Pj55OwogICAgICAgIGNoaWxkW3hdLmluc2VydCh5KTsKICAgICAgICBwYXJlbnRbeV0gPSB4OwogICAgfQoKICAgIHBhcmVudFsxXT0wOwogICAgUkVQKGksbSkKICAgIHsKLy8gICAgICAgIGNvdXQ8PCJRdWVyeTogIjw8aSsxPDwiOiBcbiI7CiAgICAgICAgY2luPj5hOwogICAgICAgIGFzc2VydChhPT0yIHx8IGE9PTEpOwogICAgICAgIGlmKGE9PTEpCiAgICAgICAgewogICAgICAgICAgICBjaW4+Png+Pnk7CiAgICAgICAgICAgIHVwZFt4XSs9eTsKICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgY2luPj55OwogICAgICAgICAgICBjb3V0PDxjb3N0KHksMSwwKTw8ZW5kbDsKICAgICAgICB9CiAgICB9Cn0K