#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace::std;
using lint=long long;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
__attribute__((constructor))
void init(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(15);
}

template<typename T>
struct persistent_array{
    struct node;
    using np=node*;
    struct node{
        T data;
        np ch[20];
    };
    np root=nullptr;
    persistent_array(){}
    np get_root(){
        return root;
    }
    np set(int idx,T val,const np& t){
        np res=new node();
        if(t){
            memcpy(res->ch,t->ch,sizeof(t->ch));
            res->data=t->data;
        }
        if(idx==0){
            res->data=val;
        }else{
            res->ch[idx%20]=set(idx/20,val,res->ch[idx%20]);
        }
        return res;
    }
    T get(int idx,np t){
        if(!t)return 0;
        if(idx==0){
            return t->data;
        }else{
            return get(idx/20,t->ch[idx%20]);
        }
    }
};

template<typename Int>
class LCA{
    template<typename T>
    class sparse_table{
        using F=function<T(T,T)>;
        F f;
        vector<vector<T>>data;
        public:
        sparse_table(vector<T> v,F f):f(f){
            int n=v.size(),log=log2(n)+1;
            data.resize(n,vector<T>(log));
            for(int i=0;i<n;i++)data[i][0]=v[i];
            for(int j=1;j<log;j++)for(int i=0;i+(1<<(j-1))<n;i++){
                data[i][j]=f(data[i][j-1],data[i+(1<<(j-1))][j-1]);
            }
        }
        T get(int l,int r){
            if(r<l)swap(l,r);
            int k=log2(r-l);
            return f(data[l][k],data[r-(1<<k)][k]);
        }
    };
    vector<pair<Int,Int>> data;
    vector<Int> start;
    sparse_table<pair<Int,Int>>* st;
    public:
    LCA(vector<vector<Int>> v,Int s){
        data.resize(v.size()*2-1);
        start.resize(v.size());
        Int i=0;
        auto Y=[&](auto f){return[&](auto... args){return f(f, args...);};};
        vector<Int> dep=depth(s,v);
        auto f=Y([&](auto f,Int n,Int p)->void{
            start[n]=i;
            data[i++]=make_pair(dep[n],n);
            for(Int t:v[n]){
                if(t==p)continue;
                f(f,t,n);
                data[i++]=make_pair(dep[n],n);
            }
        });
        f(s,-1);
        st=new sparse_table<pair<Int,Int>>(data,[](auto s,auto t){return s.first>t.first?s:t;});
    }
    Int lca(int p,int q){
        return st->get(min(start[p],start[q]),max(start[p],start[q])+1).second;
    }
    private:
    vector<Int> depth(Int start,vector<vector<Int>>G){
        auto Y=[&](auto f){return[&](auto... args){return f(f, args...);};};
        vector<Int>memo(G.size());
        auto f=Y([&](auto f,Int v,Int p)->Int{
            Int mx=0;
            for(auto t:G[v]){
                if(t==p)continue;
                mx=max(mx,f(f,t,v));
            }
            return memo[v]=mx+1;
        });
        f(start,-1);
        return memo;
    }
};

using PA=persistent_array<lint>;
int main(){
    lint n,q;
    cin>>n>>q;
    PA pa;
    PA pa2;
    vector<PA::np>v(n);
    vector<PA::np>cnt(n);
    vector<vector<tuple<lint,lint,lint>>>l(n);
    vector<vector<lint>>g(n);
    vector<lint>su(n,0);
    rep(i,n-1){
        lint a,b,c,d;
        cin>>a>>b>>c>>d;
        a--;b--;c--;
        l[a].emplace_back(b,c,d);
        l[b].emplace_back(a,c,d);
        g[a].emplace_back(b);
        g[b].emplace_back(a);
    }
    LCA<lint> lca(g,0);
    function<void(lint,lint)> f=[&](lint p,lint k){
        for(auto data:l[k]){
            lint t,c,d;
            tie(t,c,d)=data;
            if(t==p)continue;
            else{
                su[t]=su[k]+d;
                v[t]=pa.set(c,pa.get(c,v[k])+d,v[k]);
                cnt[t]=pa.set(c,pa.get(c,cnt[k])+1,cnt[k]);
                f(k,t);
            }
        }
    };
    v[0]=pa.get_root();
    cnt[0]=pa2.get_root();
    f(-1,0);
    rep(i,q){
        lint c,d,s,t;
        cin>>c>>d>>s>>t;
        c--;s--;t--;
        lint u=lca.lca(s,t);
        lint sv=su[s]+pa.get(c,cnt[s])*d-pa.get(c,v[s]);
        lint tv=su[t]+pa.get(c,cnt[t])*d-pa.get(c,v[t]);
        lint uv=su[u]+pa.get(c,cnt[u])*d-pa.get(c,v[u]);
        cout<<sv+tv-2*uv<<endl;
    }
}


Measured memory_bytes: 273824