///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define                           node(a,b,c)                 mp(a,mp(b,c))

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=100005;
const int mx=100005;
vector<pair<int,pi> >ad[M];
int ses[3*M],sum[M],cnt[M];
vector<pair<int,pi>>qry[M];
vector <int> adj[mx];
int T[mx], P[mx][22], L[mx], sub[mx];
void dfs(int from,int u,int dep){
    T[u]=from;
    L[u]=dep;
    sub[u] = 1;
    for(int i=0;i<(int)adj[u].size();i++){
        int v = adj[u][i];
        if(v==from) continue;
        dfs(u,v,dep+1);
        sub[u] += sub[v];
    }
}

int lca_query(int N, int p, int q){
    if (L[p] < L[q]) swap(p, q);
    int log = 1;
    while(1){
        int next=log+1;
        if((1<<next)>L[p])break;
        log++;
    }
    for(int i=log;i>=0;i--){
        if (L[p] - (1 << i) >= L[q]){
            p = P[p][i];
        }
    }

    if (p == q)
        return p;

    for(int i = log; i >= 0; i--){
        if(P[p][i] != -1 && P[p][i] != P[q][i]){
            p = P[p][i], q = P[q][i];
        }
    }
    return T[p];
}

void lca_init(int N){
    memset (P,-1,sizeof(P));
    dfs(-1, 0, 0);
    for(int i = 0; i < N; i++){
        P[i][0] = T[i];
    }
    for(int j=1;1<<j<N;j++){
        for(int i=0;i<N;i++){
            if(P[i][j-1]!=-1){
                P[i][j] = P[P[i][j-1]][j-1];
            }
        }
    }
 }
 void abr_dfs(int u,int p,int d)
 {
     for(auto x:qry[u])
     {
         int idx=x.fi;
         int rong=x.si.fi;
         int val=x.si.si;
         ses[idx]=d+cnt[rong]*val-sum[rong];
     }
    for(auto x:ad[u])
    {
        int v=x.fi;
        int rong=x.si.fi;
        int val=x.si.si;
        if(v!=p)
        {
            cnt[rong]++;
            sum[rong]+=val;
            abr_dfs(v,u,d+val);
            cnt[rong]--;
            sum[rong]-=val;
        }
    }
 }
 main()

{
    fast
    int n,q;
    cin>>n>>q;
    f(i,1,n-1)
    {
        int u,v,c,d;
        cin>>u>>v>>c>>d;
        ad[u].pb(node(v,c,d));
        ad[v].pb(node(u,c,d));
        adj[u-1].pb(v-1);
        adj[v-1].pb(u-1);
    }
    lca_init(n);
    f(i,1,q)
    {
        int x,y,u,v;
        cin>>x>>y>>u>>v;
        int lca=lca_query(n,u-1,v-1)+1;
        qry[lca].pb(node(i,x,y));
        qry[u].pb(node(i+q,x,y));
        qry[v].pb(node((i+2*q),x,y));
    }
    abr_dfs(1,0,0);
    f(i,1,q)
    {
        cout<<ses[i+q]+ses[i+2*q]-ses[i]-ses[i]<<"\n";
    }
    return 0;

}





































Measured memory_bytes: 57912