#include<bits/stdc++.h>
using namespace std;
vector<int>Adj[100001];
int begin1[100001];
int end1[100001];
int discover[100001];
int level[100001];
int dp[320][100001];
bool visited[100001];
long long int dp1[320];
long long int val_stored[320];
int dfs_time=0;
int SQRT_N=0;
int DFS(int u,int p,int l)
{
visited[u]=true;
begin1[u]=dfs_time;
level[u]=l;
discover[dfs_time]=u;
end1[u]=1;
dfs_time++;
for(vector<int>::iterator it=Adj[u].begin();it!=Adj[u].end();it++)
{
if(!visited[(*it)])
{
end1[u]=end1[u]+DFS((*it),u,l+1);
}
}
return end1[u];
}
void update_start(int index,int level1)
{
dp[index/SQRT_N][level1]=dp[index/SQRT_N][level1]+1;
}
void update_new(int level1,long long int val1,int n)
{
int i=0;
dp1[level1]=dp1[level1]+val1;
while(i<=n)
{
val_stored[i/SQRT_N]=val_stored[i/SQRT_N]+dp[i/SQRT_N][level1]*val1;
i=i+SQRT_N;
}
}
long long int query(int l,int h)
{
long long int ans=0;
int i=l;
//printf("(%d,%d)-> ",l,h);
while((i)%SQRT_N!=0 && i<=h)
{
ans=ans+dp1[level[discover[i]]];
//printf("%lld-_- ",dp1[level[discover[i]]]);
i++;
}
while((i+SQRT_N)<=h)
{
ans=ans+val_stored[i/SQRT_N];
//printf("%lld_-_ ",val_stored[i/SQRT_N]);
i=i+SQRT_N;
}
while(i<=h)
{
ans=ans+dp1[level[discover[i]]];
//printf("%lld-_-/ ",dp1[level[discover[i]]]);
i++;
}
//printf("\n");
return ans;
}
int main()
{
int n,m;
scanf("%d%d",&n,&m);
SQRT_N=sqrt(n);
//printf("%d\n",SQRT_N);
for(int i=1;i<n;i++)
{
int a,b;
scanf("%d%d",&a,&b);
Adj[a].push_back(b);
}
DFS(1,1,0);
for(int i=1;i<=n;i++)
{
update_start(begin1[i],level[i]);
//printf("%d %d... %d\n",begin1[i],end1[i],discover[i]);
}
for(int i=0;i<m;i++)
{
int type;
scanf("%d",&type);
if(type==1)
{
int l;
long long int y;
scanf("%d%lld",&l,&y);
update_new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