#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

struct seg{
    //総和を求める用
  vector<ll> datasum;
  //遅延用
  vector<ll> delay;
  int n;
  
  //初期化
  void init(int _n){
    n = 1;
    while( n < _n ) n*=2;
    datasum.resize( 2 * n );
    delay.resize( 2 * n );
  }

  void delaycalc(int k,int l,int r){
    datasum[k] = delay[k]<0?0:datasum[k] + delay[k]*(r-l);
    if( k+1 < n )
      for(int i=1;i<=2;i++)
        delay[2*k+i] = delay[2*k+i]+delay[k];
    delay[k] = 0;
  }

  //区間　[a,b)　に一様に　x　を足す
  void add(int a,int b,ll x,int k,int l,int r){
    delaycalc(k,l,r);
    if( r<=a || b<=l ) return;
    else if( a<=l && r<=b ){
      delay[k] = x;
      delaycalc(k,l,r);
    } else {
      add( a, b, x, 2*k + 1, l, (l+r)/2 );
      add( a, b, x, 2*k + 2, (l+r)/2, r );
      datasum[k] = datasum[2*k+1]+datasum[2*k+2];
    }
  }

 //ある区間の総和を求める
  ll querysum(int a,int b,int k,int l,int r){
    delaycalc(k,l,r);
    if( r<=a || b<=l ) return 0;
    if( a<=l && r<=b ){
      return datasum[k]+delay[k]*(r-l);
    } else {
      ll vl = querysum( a, b, 2*k+1, l,(l+r)/2 );
      ll vr = querysum( a, b, 2*k+2, (l+r)/2,r );
      return vl+vr;
    }
  } 
  void add( int a,int b,ll x){ add( a, b, x, 0,0,n); }//加える
  ll querysum(int a,int b){ return querysum(a,b,0,0,n); }//総和取得
};

struct HLD{
  int V;//頂点数
  vector<int> D,pa,size,depth,cs;
  vector<vector<int> > ch;

  vector<int> A,B;

  seg S;


  void init(int root, const vector<vector<int> >& G){
    V = (int)G.size();
    D.resize(V);
    pa.resize(V,-1);
    ch.resize(V);
    size.resize(V);
    depth.resize(V);
    cs.resize(V);

    A.resize(V);
    B.resize(V);

    for(int i=0;i<V;i++) D[i] = i;    
    bfs(root,G);

    S.init(V);
  }

  int find(int a){return a-D[a]?(D[a]=find(D[a])):a; }

  int bfs(int root,const vector<vector<int> >& G){
    queue<int> q;
    for(int i=0;i<(int)G.size();i++){
      if( i != root && G[i].size()==1 ) q.push( i );
      cs[i] = G[i].size() - (i!=root);
    }

    while( !q.empty() ){      
      int p = q.front(); q.pop(); size[p] = 1;
      int maxd = p, sum = 0;
      for(int i=0;i<(int)G[p].size();i++){
        if( !size[G[p][i]] ) {
          if( --cs[pa[p]=G[p][i]] == 0 ) q.push( pa[p] );
          continue;
        }
        sum += size[G[p][i]];
        if( size[maxd] <= size[G[p][i]] || maxd == p  ) maxd = G[p][i];
        ch[p].push_back( G[p][i] );
      }
      D[maxd] = p; size[p] += sum;                  
    }    

    q.push( root );
    A[root]=0; depth[root]=0;
    while( !q.empty() ){
      int sum = 1, p = q.front(); q.pop();
      depth[p] = (p==root?0:depth[pa[p]]+1);
      for(int i=0;i<(int)ch[p].size();i++)
        if( find(ch[p][i]) == find(p) ) { 
          A[ch[p][i]] = A[p]+sum;
          q.push( ch[p][i] );
          sum += size[ch[p][i]];
        }
      for(int i=0;i<(int)ch[p].size();i++)
        if( find(ch[p][i]) != find(p) ) { 
          A[ch[p][i]] = A[p]+sum;
          q.push( ch[p][i] );
          sum += size[ch[p][i]];
        }      
    }
    /*
    for(int i=0;i<V;i++){
      cout << "v: " << i << endl;
      cout << "depth = " << depth[i] << " , parent = " << pa[i] << " , array = " << A[i] << endl;
      B[A[i]] = i;    
    }
    */
    return find(root);
  }

  void add(int v,int x){
    S.add(A[v]+1,A[v]+size[v],x);    
  }


  ll sum(int u,int v){    
    //    cout << u <<" " << v << endl;
    ll ret = 0;
    for(;find(u) != find(v);){
      if( depth[find(u)] < depth[find(v)] ) swap(u,v);
      ret += S.querysum(A[find(u)],A[u]+1);
      u = pa[find(u)];
    }

    //    cout << "lca = " << (depth[u]<depth[v]?u:v) << endl;
    return ret + S.querysum(min(A[u],A[v])+1,max(A[u],A[v])+1);
  }
  
  
};


HLD hld;
vector<vector<int> > G;
int main(){
  int N,Q;
  scanf("%d%d",&N,&Q);
  G.resize(N);
  for(int i=0;i<N-1;i++){
    int a,b; scanf("%d%d",&a,&b);
    G[a].push_back( b );
    G[b].push_back( a );
  }
  hld.init( 0, G );

  for(int i=0;i<Q;i++){
    int k; scanf("%d",&k);
    if( k ){
      int v,x; scanf("%d%d",&v,&x);
      hld.add(v,x);
    } else {
      int u,v; scanf("%d%d",&u,&v);
      printf("%lld\n",hld.sum(u,v));      
    }
  }
}

Measured memory_bytes: 29932