#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

const int MAX_N = 150000;

struct SegmentTree {
  vint data;
  vint lazy;
  int sz;
  SegmentTree(){}
  void init(int n) {
    sz = 1; while(sz < n) sz <<= 1;
    resz(data, 2*sz-1);
    resz(lazy, 2*sz-1);
  }
  void push(int k, int l, int r) {
    if(lazy[k]) {
      data[k] += lazy[k]*(r-l);
      if(r-l > 1) {
	lazy[2*k+1] += lazy[k];
	lazy[2*k+2] += lazy[k];
      }
      lazy[k] = 0;
    }
  }
  void update(int a, int b, int x, int k, int l, int r) {
    push(k, l, r);
    if(r <= a || b <= l) return;
    if(a <= l && r <= b) {
      lazy[k] += x;
      push(k, l, r);
      return;
    }
    update(a, b, x, 2*k+1, l, (l+r)/2);
    update(a, b, x, 2*k+2, (l+r)/2, r);
    data[k] = data[2*k+1]+data[2*k+2];
  }
  void update(int a, int b, int x) {
    update(a, b, x, 0, 0, sz);
  }
  int query(int a, int b, int k, int l, int r) {
    push(k, l, r);
    if(r <= a || b <= l) return 0;
    if(a <= l && r <= b) return data[k];
    int vl = query(a, b, 2*k+1, l, (l+r)/2);
    int vr = query(a, b, 2*k+2, (l+r)/2, r);
    return vl+vr;
  }
  int query(int a, int b) {
    return query(a, b, 0, 0, sz);
  }
};

using Graph = vector<vint>;

struct HLD {
  vint vid, head, tail, heavy, par, dep, inv;
  SegmentTree seg;
  HLD(const Graph& graph, int root = 0) {
    int n = graph.size();
    resz(vid, n, -1);
    resz(head, n, -1);
    resz(tail, n, -1);
    resz(heavy, n, -1);
    resz(par, n, -1);
    resz(dep, n);
    resz(inv, n);

    seg.init(n);

    vint sz(n);
    function<void(int, int)> dfs = [&](int u, int p) {
      par[u] = p;
      sz[u] = 1;
      int mxch = -1;
      for(int v : graph[u]) {
	if(v == p) continue;
	dep[v] = dep[u]+1;
	dfs(v, u);
	sz[u] += sz[v];
	if(mxch == -1 || sz[mxch] < sz[v]) mxch = v;
      }
      heavy[u] = mxch;
    };
    dfs(root, -1);

    int k = 0;
    queue<int> que;
    que.push(root);
    while(!que.empty()) {
      int h = que.front(); que.pop();
      int t = h;
      for(int i = h; i != -1; i = heavy[i]) {
	vid[i] = k++;
	inv[vid[i]] = i;
	head[i] = h;
	t = i;
	for(int v : graph[i]) {
	  if(v != par[i] && v != heavy[i]) que.push(v);
	}
      }
      //cout<<h<<" "<<t<<endl;
      for(int i = h; i != -1; i = heavy[i]) tail[i] = t;
    }
  }
  int lca(int u, int v) {
    if(vid[u] > vid[v]) swap(u, v);
    while(head[u] != head[v]) {
      v = par[head[v]];
      if(vid[u] > vid[v]) swap(u, v);
    }
    return u;
  }

  void add(int u, int x) {
    int l = vid[u], r = vid[tail[u]];
    //cout<<u<<" "<<tail[u]<<" "<<l<<" "<<r<<endl;
    seg.update(l, r, x);
  }
  int ask(int u, int v) {
    //cout<<calc(u)<<" "<<calc(v)<<endl;
    return calc(u)+calc(v)-2*calc(lca(u, v));
  }
  int calc(int u) {
    int res = 0;
    int v = u;
    //cout<<v<<" "<<head[v]<<endl;
    while(head[v] != 0) {
      res += seg.query(vid[head[v]], vid[v]);
      //cout<<res<<endl;
      int p = par[head[v]];
      //cout<<u<<" "<<p<<" "<<dep[u]<<" "<<dep[p]<<" "<<endl;
      if(p != -1) res += seg.query(vid[p], vid[p]+1)*(dep[u]-dep[p]);//val[p]*(dep[u]-dep[p]);
      //cout<<res<<endl;
      v = p;
    }
    res += seg.query(0, vid[v]);
    //cout<<v<<" " << vid[v]<<" "<<res<<endl;
    return res;
  }
};

int n, q;
Graph graph;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin >> n >> q;
  resz(graph, n);
  rep(i, n-1) {
    int a, b;
    cin >> a >> b;
    graph[a].push_back(b);
  }
  HLD hld(graph);
  rep(i, q) {
    int t, u, v;
    cin >> t >> u >> v;
    if(t == 0) {
      cout << hld.ask(u, v) << endl;
    } else {
      hld.add(u, v);
    }
  }

  return 0;
}



Measured memory_bytes: 45052