#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,NAME,...) NAME
#define pr(...) GET_MACRO(__VA_ARGS__,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)
#define pr1(a) (#a)<<"="<<(a)
#define pr2(a,b) pr1(a)<<", "<<pr1(b)
#define pr3(a,b,c) pr2(a,b)<<", "<<pr1(c)
#define pr4(a,b,c,d) pr3(a,b,c)<<", "<<pr1(d)
#define pr5(a,b,c,d,e) pr4(a,b,c,d)<<", "<<pr1(e)
#define int long long
#define double long double
using namespace std;
const int N = 100010;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
typedef pair<int,int> P;
typedef long long ll;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}


class RSQ{
public:
  typedef long long ll;
  ll n;
  vector<ll> dat,td;
  
  RSQ(){n = -1;}
  RSQ(int n_){
    n=1;
    while(n<n_)n*=2; //要素数nを2のべき乗に
    dat.resize(2*n-1,0),td.resize(2*n-1,0);
  }
  
  //[a,b)の区間にxを加算する,query(a,b,x);
  ll add(int a,int b,ll x,int k=0,int l=0,int r=-1){
    if(r==-1) r=n, assert(a < n && b <= n);
    if(r<=a||b<=l)return 0;
    if(a<=l&&r<=b){
      dat[k]+=(r-l)*x; 
      td[k]+=x;
      return dat[k];
    }

    dat[k]+=(min(r,b)-max(l,a))*x;
    ll kl=k*2+1,kr=k*2+2,t=td[k]*(r-l)/2;
    dat[kl]+=t, dat[kr]+=t;
    td[kl]+=td[k], td[kr]+=td[k];
    td[k]=0;

    ll vl=add(a,b,x,k*2+1,l,(l+r)/2);
    ll vr=add(a,b,x,k*2+2,(l+r)/2,r);
    return vl+vr;
  }
  
  //[a,b)の総和を得る
  ll sum(int a,int b){return add(a,b,0);}
};


class HLD{
public:
  int V;                     //ノード数
  int root;                  //根の頂点番号
  vector<vector<int> > G;    //Grapth
  vector<int> par;           //parent: par[元の頂点番号]->元の頂点番号
  vector<int> Hchild;        //各ノードから伸びるHeavy Childの頂点番号: Hedge[元の頂点番号]->元の頂点番号
  vector<int> number;        //各ノードに割り当てなおした頂点番号: number[元の頂点番号]->振り直した頂点番号
  vector<int> id;            //割り当て直した数字の元のノード番号: id[振り直した頂点番号]->元の頂点番号
  vector<int> group;         //各ノードが所属するグループ番号: group[元の頂点番号]->元の頂点番号
  vector<int> depth;         //根からの各ノードの深さ: depth[元の頂点番号]
  bool ok;                   //build()が済んでいるか
  
  HLD(){root = V = -1;}
  HLD(int V):V(V), root(0), G(V), par(V,-1), Hchild(V,-1), 
             number(V,-1),id(V,-1),group(V,-1),depth(V,0),ok(false){}
  
  void add_edge(int a,int b){
    assert(a < V && b < V);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  void build(int _root = 0){
    root = _root;
    int num = 0;
    ok = true;
    dfs1(); numbering(num); dfs2();
  }

  int dfs1(int pos = -1,int pre = -1){
    if(pos == -1) pos = root;
    int mx = -1, weight = 1;
    for(int to:G[pos]){
      if(to == pre) continue;
      int cweight = dfs1(to,pos);
      weight += cweight;
      if(mx < cweight) Hchild[pos] = to, mx = cweight;
    }
    return weight;
  }
  
  void dfs2(int pos = -1,int pre = -1,int dep = 0,int g = -1){
    if(pos == -1) pos = g = root;
    par[pos] = pre;
    depth[pos] = dep;
    group[pos] = g;
    for(int to:G[pos]) if(to!=pre) dfs2(to,pos,dep+1,Hchild[pos]==to? g:to);
  }
  
  void numbering(int &cnt,int pos = -1,int pre = -1){
    if(pos == -1) pos = root;
    number[pos] = cnt++;
    id[number[pos]] = pos;
    if(Hchild[pos]>=0) numbering(cnt,Hchild[pos],pos);
    for(int to:G[pos])if(to!=pre && to!=Hchild[pos]) numbering(cnt,to,pos);
  }
  
  typedef pair<int,int> P;
  vector<P> paths;  //[u,v]間の経路をいくつかの「閉区間の連番の経路」に分解する。(最大logN個に分解される)
  vector<P> Ledges; //paths同士を結ぶライトエッジ
  void buildPaths(int u,int v){
    if(depth[group[u]] < depth[group[v]]) swap(u,v);// 深い方のノードから処理する。
    int nu=number[u], nv=number[v];
    if(same(u,v)){ paths.push_back(P(min(nu,nv),max(nu,nv)));return;} 

    int gu = group[u];
    buildPaths(par[gu],v);

    paths.push_back(P(number[gu], number[u]));
    Ledges.push_back(P(number[par[gu]], number[gu]));
  }

  int lca(int u,int v){
    if(depth[group[u]] < depth[group[v]]) swap(u,v);
    if(same(u,v)) return depth[u] < depth[v]? u:v;
    return lca(par[group[u]],v);
  }
  
  pair<vector<P>, vector<P> > getPath(int u,int v){
    assert(ok && "Please Build");
    paths.clear();
    Ledges.clear();
    buildPaths(u,v);
    return make_pair(paths,Ledges);
  }
  
  
  /*(元の頂点番号,元の頂点番号)*/ 
  bool same(int a,int b){return group[a] == group[b];}
};

class EulerTour{
public:
  int V;                     //ノード数
  int root;                  //根の頂点番号
  vector<vector<int> > G;    //Grapth
  vector<int> L,R; //[L,R]
  bool ok;
  EulerTour():V(-1),ok(0){};
  EulerTour(int V,int root=0):V(V),root(root),G(V),L(V),R(V),ok(0){}

  void add_edge(int a,int b){
    assert(a >= 0 && b >= 0);
    assert(a < V && b < V);
    G[a].push_back(b);
    G[b].push_back(a);
  }

  void build(){
    ok = 1;
    int cnt = 0;
    function<void(int,int)> dfs = [&](int pos,int pre){
      L[pos] = cnt;
      for(int to:G[pos]) if(to != pre) cnt++, dfs(to, pos);
      R[pos] = cnt;
    };
    dfs(root,-1);
  }

  
  typedef pair<int,int> P;
  P get(int v){assert(ok); return P(L[v],R[v]);} //[l, r)
};


signed main(){
  int n,Q;
  cin>>n>>Q;

  HLD hld(n);

  for(int i=0;i<n-1;i++){
    int a,b;
    cin>>a>>b;
    hld.add_edge(a,b);
  }


  hld.build();

  
  EulerTour et(n);
  for(int u=0;u<n;u++)
    for(int v:hld.G[u]){
      if(u > v) continue;
      int a = hld.number[u];
      int b = hld.number[v];
      et.add_edge(a, b);
    }

  for(int i=0;i<n;i++) sort(et.G[i].begin(),et.G[i].end());
  et.build();
  
  RSQ rsq(n+100);
  auto dis=[&](int u,int v){
    if(hld.depth[u] > hld.depth[v]) swap(u,v);
    int res = 0;
    auto p = hld.getPath(u,v);
    auto path = p.first;
    auto ledge = p.second;
    
    for(auto p:path){
      int l,r; tie(l,r) = p;
      //cout<<pr(l,r)<<" ";
      res += rsq.sum(l,r+1);
    }

    int lca = hld.lca(u,v);
    lca = hld.number[lca];
    res -= rsq.sum(lca,lca+1);
    return res;
  };
  
  for(int i=0;i<n;i++) assert(hld.number[i] == et.L[hld.number[i]]);
  
  auto add=[&](int v,int x){
    int l,r; tie(l,r) = et.get(hld.number[v]);
    //cout<<pr(l,r)<<endl;
    rsq.add(l+1,r+1,x);
  };
  
  while(Q--){
    int cmd;
    cin>>cmd;

    if(cmd == 0){
      int u,v;
      cin>>u>>v;
      int ans = dis(u,v);
      cout<<ans<<endl;
    }
    
    if(cmd == 1){
      int v,x;
      cin>>v>>x;
      add(v,x);
    }
  }
  
  return 0;
}



Measured memory_bytes: 85960