#include <bits/stdc++.h>
#define var auto
using ll = long long;
const char newl = '\n';
template <typename T1, typename T2> inline void chmin(T1& a, T2 b) {if(a > b) a = b;}
template <typename T1, typename T2> inline void chmax(T1& a, T2 b) {if(a < b) a = b;}
using namespace std;

class HLD {
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 &pos) {
        vid[v]=pos++;
        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,pos);
        }
    }

public:
    vector< vector<int> > G;
    vector<int> vid, head, sub, par, dep, inv, type;

    HLD(int n):
            G(n),vid(n,-1),head(n),sub(n,1),
            par(n,-1),dep(n,0),inv(n),type(n){}

    void add_edge(int u,int v) {
        G[u].emplace_back(v);
        G[v].emplace_back(u);
    }

    void build(vector<int> rs={0}) {
        int c=0,pos=0;
        for(int r:rs){
            dfs_sz(r);
            head[r]=r;
            dfs_hld(r,c++,pos);
        }
    }

    int lca(int u,int v){
        while(1){
            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)];
    }

    // for_each(vertex)
    // [l, r) <- attention!!
    template<typename F>
    void for_each(int u, int v, const F& f) {
        while(1){
            if(vid[u]>vid[v]) swap(u,v);
            f(max(vid[head[v]],vid[u]),vid[v]+1);
            if(head[u]!=head[v]) v=par[head[v]];
            else break;
        }
    }

    template<typename T,typename Q,typename F>
    T for_each(int u,int v,T ti,const Q &q,const F &f){
        T l=ti,r=ti;
        while(1){
            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]) v=par[head[v]];
            else break;
        }
        return f(l,r);
    }

    // for_each(edge)
    // [l, r) <- attention!!
    template<typename F>
    void for_each_edge(int u, int v,const F& f) {
        while(1){
            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;
            }
        }
    }
};

template <typename T,typename E>
struct SegmentTree{
    using F = function<T(T,T)>;
    using G = function<T(T,E)>;
    using H = function<E(E,E)>;
    int n,height;
    F f;
    G g;
    H h;
    T ti;
    E ei;
    vector<T> dat;
    vector<E> laz;
    SegmentTree(F f,G g,H h,T ti,E ei):
            f(f),g(g),h(h),ti(ti),ei(ei){}

    void init(int n_){
        n=1;height=0;
        while(n<n_) n<<=1,height++;
        dat.assign(2*n,ti);
        laz.assign(2*n,ei);
    }

    void build(const vector<T> &v){
        int n_=v.size();
        init(n_);
        for(int i=0;i<n_;i++) dat[n+i]=v[i];
        for(int i=n-1;i;i--)
            dat[i]=f(dat[(i<<1)|0],dat[(i<<1)|1]);
    }

    inline T reflect(int k){
        return laz[k]==ei?dat[k]:g(dat[k],laz[k]);
    }

    inline void propagate(int k){
        if(laz[k]==ei) return;
        laz[(k<<1)|0]=h(laz[(k<<1)|0],laz[k]);
        laz[(k<<1)|1]=h(laz[(k<<1)|1],laz[k]);
        dat[k]=reflect(k);
        laz[k]=ei;
    }

    inline void thrust(int k){
        for(int i=height;i;i--) propagate(k>>i);
    }

    inline void recalc(int k){
        while(k>>=1)
            dat[k]=f(reflect((k<<1)|0),reflect((k<<1)|1));
    }

    void update(int a,int b,E x){
        if(a>=b) return;
        thrust(a+=n);
        thrust(b+=n-1);
        for(int l=a,r=b+1;l<r;l>>=1,r>>=1){
            if(l&1) laz[l]=h(laz[l],x),l++;
            if(r&1) --r,laz[r]=h(laz[r],x);
        }
        recalc(a);
        recalc(b);
    }

    void set_val(int a,T x){
        thrust(a+=n);
        dat[a]=x;laz[a]=ei;
        recalc(a);
    }

    T query(int a,int b){
        if(a>=b) return ti;
        thrust(a+=n);
        thrust(b+=n-1);
        T vl=ti,vr=ti;
        for(int l=a,r=b+1;l<r;l>>=1,r>>=1) {
            if(l&1) vl=f(vl,reflect(l++));
            if(r&1) vr=f(reflect(--r),vr);
        }
        return f(vl,vr);
    }

    template<typename C>
    int find(int st,C &check,T &acc,int k,int l,int r){
        if(l+1==r){
            acc=f(acc,reflect(k));
            return check(acc)?k-n:-1;
        }
        propagate(k);
        int m=(l+r)>>1;
        if(m<=st) return find(st,check,acc,(k<<1)|1,m,r);
        if(st<=l&&!check(f(acc,dat[k]))){
            acc=f(acc,dat[k]);
            return -1;
        }
        int vl=find(st,check,acc,(k<<1)|0,l,m);
        if(~vl) return vl;
        return find(st,check,acc,(k<<1)|1,m,r);
    }

    template<typename C>
    int find(int st,C &check){
        T acc=ti;
        return find(st,check,acc,1,0,n);
    }
};

int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    ll 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();

    SegmentTree<pair<ll, ll>, ll> segTree(
            [](pair<ll, ll> a, pair<ll, ll> b){
                return make_pair(a.first + b.first, a.second + b.second);
            },
            [](pair<ll, ll> a, ll b){
                return make_pair(a.first + a.second * b, a.second);
            },
            [](ll a, ll b){ return a + b; },
            make_pair(0LL, 0LL),
            0
        );
    segTree.build(vector<pair<ll, ll>>(n, make_pair(0, 1)));

    for (int i = 0; i < q; i++){
        int type;
        cin >> type;
        if (type == 0){
            int u, v;
            cin >> u >> v;
            ll res = 0;
            hld.for_each_edge(u, v, [&](int a, int b){
               res += segTree.query(a, b).first;
            });
            cout << res << newl;
        }
        else {
            int v, x;
            cin >> v >> x;
            segTree.update(hld.vid[v] + 1, hld.vid[v] + hld.sub[v], x);
        }
    }

    return 0;
}


Measured memory_bytes: 36164