#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 0) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL sum = a;
    LL res = 1;
    while(b){
        if(b&1){
            res = (res * sum)%MOD;
        }
        sum = (sum * sum) % MOD;
        b>>=1;
    }
    return res;
}

class road{
    public:
        int first;
        int second;
        int third;
        road(int a, int b, int c):first(a), second(b), third(c){}
};

vector<vector<road> > roads;
vector<int> dist;
vector<vector<int> > parent;
vector<int> depth;
vector<int> countp;
vector<vector<PII> > num;
vector<vector<PII> > sum;

void culdist(int place, int num){
    dist[place]=num;
    foreach(i, roads[place]){
        if(dist[i.first]>=0)continue;
        culdist(i.first, num + i.second); 
    }
}

void makeparent(int place){
    foreach(i, roads[place]){
        if(parent[i.first][0])continue;
        parent[i.first][0]=place;
        makeparent(i.first);
    }
}

void makedepth(int place, int now){
    depth[place]=now;
    foreach(i, roads[place]){
        if(depth[i.first]>=0)continue;
        makedepth(i.first, now+1);
    }
}

int culparent(int place, int remain){
   if(place==1)return 1;
   if(parent[place][remain])return parent[place][remain];
   return parent[place][remain] = culparent(culparent(place, remain-1), remain-1);
}

int getnear(int a, int b){
    if(depth[a]>depth[b]){
        int d = depth[a]-depth[b];
        for(int i=19;i>=0;--i){
            if(d&BIT(i)){
                a = parent[a][i];
            }
        }
    }else if(depth[b]>depth[a]){
        int d = depth[b]-depth[a];
        for(int i=19;i>=0;--i){
            if(d&BIT(i)){
                b = parent[b][i];
            }
        }
    }
    if(a==b)return a;
    for(int i=19;i>=0;--i){
        if(parent[a][i]!=parent[b][i]){
            a=parent[a][i];
            b=parent[b][i];
        }
    }
    return parent[a][0];
}

int counting(int place, int nc){
    countp[place]=nc;
    foreach(i, roads[place]){
        if(countp[i.first]>=0)continue;
        ++nc;
        num[i.third].push_back(PII(nc, num[i.third].back().second+1));
        sum[i.third].push_back(PII(nc, sum[i.third].back().second+i.second));
        nc = counting(i.first, nc+1);
        num[i.third].push_back(PII(nc, num[i.third].back().second-1));
        sum[i.third].push_back(PII(nc, sum[i.third].back().second-i.second));
    }
    return nc + 1;
}

int main(){
    int N, Q;
    cin>>N>>Q;
    roads.resize(N+1);
    dist.resize(N+1, -1);
    parent.resize(N+1, vector<int>(20, 0));
    depth.resize(N+1, -1);
    countp.resize(N+1, -1);
    num.resize(N+1);
    sum.resize(N+1);
    REP(i, N+1){
        num[i].push_back(PII(-1, 0));
        sum[i].push_back(PII(-1, 0));
    }
    REP(i, N-1){
        int a, b, c, d;
        cin>>a>>b>>c>>d;
        roads[a].push_back(road(b, d, c));
        roads[b].push_back(road(a, d, c));
    }
    culdist(1, 0);
    makeparent(1);
    makedepth(1, 0);
    REPA(i, N+1){
        REP(j, 20){
            culparent(i, j);
        }
    }
    counting(1, 0);
    REP(i, Q){
        int x, y, a, b;
        cin >> x >> y >> a >> b;
        int ans = 0;
        ans = dist[a] + dist[b] - 2 * dist[getnear(a, b)];
        ans += ((lower_bound(ALL(num[x]), PII(countp[a], 0))-1)->second + (lower_bound(ALL(num[x]), PII(countp[b], 0))-1)->second) * y;
        ans -= 2 * (lower_bound(ALL(num[x]), PII(countp[getnear(a, b)], 0))-1)->second * y;
        ans -= (lower_bound(ALL(sum[x]), PII(countp[a], 0))-1)->second + (lower_bound(ALL(sum[x]), PII(countp[b], 0))-1)->second;
        ans += 2 * (lower_bound(ALL(sum[x]), PII(countp[getnear(a, b)], 0))-1)->second;
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 38820