#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

template<class T, class E>
struct LazySegmentTree {
private:
    int n;
    vector<T> node;
    vector<E> lazy;
    vector<bool> updated;
    T def;
    function<T(T,T)> out;
    function<T(T,E,int)> app;
    function<E(E,E)> lop;
    
    void propagate(int k, E x) {
        if (updated[k]) {
            lazy[k] = lop(lazy[k], x);
        }
        else {
            lazy[k] = x;
            updated[k] = true;
        }
    }
    
    void evaluate(int k, int l, int r) {
        if (updated[k]) {
            node[k] = app(node[k], lazy[k], r - l);
            if ((r - l) > 1) {
                propagate(k * 2 + 1, lazy[k]);
                propagate(k * 2 + 2, lazy[k]);
            }
            updated[k] = false;
        }
    }
    
public:
    LazySegmentTree() {}
    LazySegmentTree(const vector<T> &v, T _def, function<E(E,E)> _lop, function<T(T,E,int)> _app, function<T(T,T)> _out) {
        def = _def; out = _out; app = _app; lop = _lop;
        int vl = (int)v.size();
        n = 1; while(n < vl) n *= 2;
        node.resize(2 * n - 1, def);
        lazy.resize(2 * n - 1);
        updated.resize(2 * n - 1, false);
        for(int i = 0; i < vl; i++) node[i + n - 1] = v[i];
        for(int i = n - 2; i >= 0; i--) node[i] = out(node[i * 2 + 1], node[i * 2 + 2]);
    }
    
    void update(int a, int b, E x, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = n;
        evaluate(k, l, r);
        if((b <= l) || (r <= a)) return;
        if((a <= l) && (r <= b)) {
            propagate(k, x);
            evaluate(k, l, r);
        }
        else {
            update(a, b, x, 2 * k + 1, l, (l + r) / 2);
            update(a, b, x, 2 * k + 2, (l + r) / 2, r);
            node[k] = out(node[2 * k + 1], node[2 * k + 2]);
        }
    }
    
    T query(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = n;
        evaluate(k, l, r);
        if ((b <= l) || (r <= a)) return def;
        if ((a <= l) && (r <= b)) return node[k];
        T vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
        return out(vl, vr);
    }
};

struct HeavyLightDecomposition {
private:
    void dfs_sz(int v) {
        for(int &u : g[v]) {
            if (u == par[v]) swap(u, g[v].back());
        }
        if (~par[v]) g[v].pop_back();
        for(int &u : g[v]) {
            par[u] = v;
            dep[u] = dep[v] + 1;
            dfs_sz(u);
            sub[v] += sub[u];
            if (sub[u] > sub[g[v][0]]) swap(u, g[v][0]);
        }
    }
    
    void dfs_hld(int v, int c, int &idx) {
        vid[v] = idx++;
        inv[vid[v]] = v;
        type[v] = c;
        for(int &u : g[v]) {
            if (u == par[v]) continue;
            head[u] = ((u == g[v][0]) ? head[v] : u);
            dfs_hld(u, c, idx);
        }
    }
    
public:
    vector<vector<int>> g;
    vector<int> par, sub, dep, vid, inv, type, head;
    
    HeavyLightDecomposition() {}
    HeavyLightDecomposition(int n) {
        g.resize(n);
        par.resize(n, -1);
        dep.resize(n, 0);
        sub.resize(n, 1);
        vid.resize(n, -1);
        inv.resize(n);
        type.resize(n);
        head.resize(n);
    }
    
    void add_edge(int u, int v) {
        g[u].push_back(v);
        g[v].push_back(u);
    }
    
    void build(vector<int> rs = {0}) {
        int c = 0, idx = 0;
        for(int r : rs) {
            dfs_sz(r);
            head[r] = r;
            dfs_hld(r, c++, idx);
        }
    }
    
    int lca(int u, int v) {
        while(true) {
            if (vid[u] > vid[v]) swap(u, v);
            if (head[u] == head[v]) return u;
            v = par[head[v]];
        }
    }
    
    int distance(int u, int v) {
        return dep[u] + dep[v] - 2 * dep[lca(u, v)];
    }
    
    template<class F>
    void for_each(int u, int v, const F &f) {
        while(true) {
            if (vid[u] > vid[v]) swap(u, v);
            f(max(vid[head[v]], vid[u]), vid[v] + 1);
            if (head[u] == head[v]) break;
            v = par[head[v]];
        }
    }
    
    template<class T, class Q, class F>
    T for_each(int u, int v, T ti, const Q &q, const F &f) {
        T l = ti, r = ti;
        while(true) {
            if (vid[u] > vid[v]) {
                swap(u, v);
                swap(l, r);
            }
            l = f(l, q(max(vid[head[v]], vid[u]), vid[v] + 1));
            if (head[u] == head[v]) break;
            v = par[head[v]];
        }
        return f(l, r);
    }
    
    template<class F>
    void for_each_edge(int u, int v, const F &f) {
        while(true) {
            if (vid[u] > vid[v]) swap(u, v);
            if (head[u] != head[v]) {
                f(vid[head[v]], vid[v] + 1);
                v = par[head[v]];
            }
            else {
                if (u != v) f(vid[u] + 1, vid[v] + 1);
                break;
            }
        }
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, q;
    cin >> n >> q;
    HeavyLightDecomposition hld(n);
    rep(i, n - 1) {
        ll a, b;
        cin >> a >> b;
        hld.add_edge(a, b);
    }
    hld.build();
    auto lop = [](ll a, ll b){ return a + b; };
    auto app = [](ll a, ll b, ll c){ return a + b * c; };
    auto out = [](ll a, ll b){ return a + b; };
    LazySegmentTree<ll, ll> lst(vector<ll>(n, 0), 0, lop, app, out);
    rep(i, q) {
        ll t;
        cin >> t;
        if (t == 0) {
            ll u, v;
            cin >> u >> v;
            ll ans = 0;
            auto f = [&](int l, int r){ ans += lst.query(l, r); };
            hld.for_each_edge(u, v, f);
            cout << ans << endl;
        }
        else {
            ll v, x;
            cin >> v >> x;
            lst.update(hld.vid[v] + 1, hld.vid[v] + hld.sub[v], x);
        }
    }
    return 0;
}



Measured memory_bytes: 30788