#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
using namespace std;
inline int scan(){
char c = getchar();
int x = 0;
while(c<'0'||c>'9'){
c=getchar();
}
while(c>='0'&&c<='9'){
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return x;
}
const int N = 100001;
const int SQN = 350;
int freq[SQN][N]={0};
long long val[SQN]={0};
int start[SQN];
int finish[SQN];
int n,sqn,m;
int timer=0;
int treestart[N];
int treeend[N];
int rev[N];
list<int> v[N];
int level[N]={0};
int lookup[N];
long long sum[N]={0};
void dfs(int node,int parent){
level[node]=level[parent]+1;
treestart[node]=++timer;
rev[timer]=node;
for(list<int>::iterator it = v[node].begin();it!=v[node].end();++it){
if(*it!=parent)
dfs(*it,node);
}
treeend[node]=timer;
}
int main(){
n=scan(),m=scan();
for(int i=1;i<n;++i){
int a=scan(),b=scan();
v[a].pb(b);
v[b].pb(a);
}
dfs(1,0);
int sqn = sqrt(n);
int cur=1;
for(int i=1;i<=n;){
int j=i;
start[cur]=i;
while(j<i+sqn&&j<=n){
freq[cur][level[rev[j]]]++;
j++;
lookup[j-1]=cur;
}
i=j;
finish[cur]=j-1;
++cur;
}
while(m--){
int type=scan();
if(type==1){
int levl = scan();
long long vall = scan();
for(int i=1;i<cur;++i){
val[i]+=1LL*freq[i][levl+1]*vall;
}
sum[levl+1]+=vall;
}
else{
int node = scan();
int x=lookup[treestart[node]];
int y=lookup[treeend[node]];
long long res=0;
for(int i=x;i<=y;++i){
if(start[i]>=treestart[node]&&finish[i]<=treeend[node]){
res+=val[i];
}
else if(start[i]<treestart[node]){
for(int j=treestart[node];j<=min(treeend[node],finish[i]);++j){
res+=sum[level[rev[j]]];
}
}
else{
for(int j= max(start[i],treestart[node]);j<=treeend[node];++j){
res+=sum[level[rev[j]]];
}
}
}
printf("%lld\n",res);
}
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBtcCBtYWtlX3BhaXIKd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ludCBhPXNjYW4oKSxiPXNjYW4oKTsKICAgICAgICB2W2FdLnBiKGIpOwogICAgICAgIHZbYl0ucGIoYSk7CiAgICB9CiAgICBkZnMoMSwwKTsKICAgIGludCBzcW4gPSBzcXJ0KG4pOwogICAgaW50IGN1cj0xOwogICAgZm9yKGludCBpPTE7aTw9bjspewogICAgICAgIGludCBqPWk7CiAgICAgICAgc3RhcnRbY3VyXT1pOwogICAgICAgIHdoaWxlKGo8aStzcW4mJmo8PW4pewogICAgICAgICAgICBmcmVxW2N1cl1bbGV2ZWxbcmV2W2pdXV0rKzsKICAgICAgICAgICAgaisrOwogICAgICAgICAgICBsb29rdXBbai0xXT1jdXI7CiAgICAgICAgfQogICAgICAgIGk9ajsKICAgICAgICBmaW5pc2hbY3VyXT1qLTE7CiAgICAgICAgKytjdXI7CiAgICB9CiAgICB3aGlsZShtLS0pewogICAgICAgIGludCB0eXBlPXNjYW4oKTsKICAgICAgICBpZih0eXBlPT0xKXsKICAgICAgICAgICAgaW50IGxldmwgPSBzY2FuKCk7CiAgICAgICAgICAgIGxvbmcgbG9uZyB2YWxsID0gc2NhbigpOwogICAgICAgICAgICBmb3IoaW50IGk9MTtpPGN1cjsrK2kpewogICAgICAgICAgICAgICAgdmFsW2ldKz0xTEwqZnJlcVtpXVtsZXZsKzFdKnZhbGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc3VtW2xldmwrMV0rPXZhbGw7CiAgICAgICAgfQogICAgICAgIGVsc2V7CiAgICAgICAgICAgIGludCBub2RlID0gc2NhbigpOwogICAgICAgICAgICBpbnQgeD1sb29rdXBbdHJlZXN0YXJ0W25vZGVdXTsKICAgICAgICAgICAgaW50IHk9bG9va3VwW3RyZWVlbmRbbm9kZV1dOwogICAgICAgICAgICBsb25nIGxvbmcgcmVzPTA7CiAgICAgICAgICAgIGZvcihpbnQgaT14O2k8PXk7KytpKXsKICAgICAgICAgICAgICAgIGlmKHN0YXJ0W2ldPj10cmVlc3RhcnRbbm9kZV0mJmZpbmlzaFtpXTw9dHJlZWVuZFtub2RlXSl7CiAgICAgICAgICAgICAgICAgICAgcmVzKz12YWxbaV07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIGlmKHN0YXJ0W2ldPHRyZWVzdGFydFtub2RlXSl7CiAgICAgICAgICAgICAgICAgICAgZm9yKGludCBqPXRyZWVzdGFydFtub2RlXTtqPD1taW4odHJlZWVuZFtub2RlXSxmaW5pc2hbaV0pOysrail7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlcys9c3VtW2xldmVsW3JldltqXV1dOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2V7CiAgICAgICAgICAgICAgICAgICAgZm9yKGludCBqPSBtYXgoc3RhcnRbaV0sdHJlZXN0YXJ0W25vZGVdKTtqPD10cmVlZW5kW25vZGVdOysrail7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlcys9c3VtW2xldmVsW3JldltqXV1dOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBwcmludGYoIiVsbGRcbiIscmVzKTsKICAgICAgICB9CiAgICB9Cn0=