#include<bits/stdc++.h>
#define pb           push_back
#define pii          pair<int,int>
#define vi           vector<int>
#define vpii         vector<pair<int,int>>
#define gph          map<int, vector<int>>
#define mp           make_pair
#define FOR(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD0(i, n) for (int i = (int)n; i >= 0; i--)
#define FORD1(i, n) for (int i = (int)n; i >= 1; i--)
#define FORS(i, n) for(; i < (int)(n); i++)
#define debug(X) { cout << #X << " = " << (X) << endl; }
#define printArr(A,n) { cout << #A << " = "; FOR(i,n) cout << A[i] << ' '; cout << endl; }
using namespace std;
#define int long long int
int n, l;
vector<vector<pair<int, pii>>> adj;

int timer;
vector<int> tin, tout;
vector<vector<int>> up;
vector<int> dist;
vector<vpii> sum;
vector<vpii> eCount;
vi target;
void dfs(int v, int p, int dis)
{
    tin[v] = ++timer;
    up[v][0] = p;
    dist[v] = dis;
    for (int i = 1; i <= l; ++i)
        up[v][i] = up[up[v][i-1]][i-1];

    for (auto val : adj[v]) {
        int u = val.first;
        if (u != p){
            sum[val.second.first].pb(mp(timer, val.second.second ));
            eCount[val.second.first].pb(mp(timer, 1));
            target[u] = timer;
            dfs(u, v, dis + val.second.second);
            sum[val.second.first].pb({timer, -val.second.second});
            eCount[val.second.first].pb(mp(timer, -1));
       }
    }

    tout[v] = ++timer;
}

bool is_ancestor(int u, int v)
{
    return tin[u] <= tin[v] && tout[u] >= tout[v];
}

int lca(int u, int v)
{
    if (is_ancestor(u, v))
        return u;
    if (is_ancestor(v, u))
        return v;
    for (int i = l; i >= 0; --i) {
        if (!is_ancestor(up[u][i], v))
            u = up[u][i];
    }
    return up[u][0];
}

void preprocess(int root) {
    tin.resize(n + 1);
    tout.resize(n + 1);
    timer = 0;
    l = ceil(log2(n + 1));
    up.assign(n + 1, vector<int>(l + 1));
    dfs(root, root, 0);
}
int getVal(const vpii& vec, int to){
    if(vec.empty())return 0;
    auto it = upper_bound(vec.begin(), vec.end(), mp(to, (long long)INT_MAX));//to + 1
    if(it == vec.begin())return 0;
    it--;
    return it->second;
}
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    
    int q;cin >> n >> q;
    int a, b, c, d, newLen, u ,v;
    dist.resize(n+1);
    target.resize(n+1);
    sum.resize(n);
    eCount.resize(n);
    adj.resize(n+1);
    FOR(i, n- 1){
        cin >> a >> b >> c >> d;
        adj[a].pb(mp(b, mp(c,d)));
        adj[b].pb(mp(a, mp(c,d)));
    }

    preprocess(1);
    FOR1(i, n-1){
        int prev= 0;
        for(pii& x: eCount[i]){
           x.second += prev; 
           prev += x.second - prev;
        }
        prev = 0;
        for(pii& x: sum[i]){
            x.second += prev;
            prev += x.second - prev;
        }
    }
/*    cout <<endl;for(pii& x: sum[1]){
        cout <<x.first << " " << x.second << " |";
    }cout <<endl;
    for(pii& x: eCount[1]){
        cout <<x.first << " " << x.second << " |";
    }
    cout <<endl;*/
    FOR(i, q){
        cin >> c >> newLen >> u >> v;
        int common = lca(u, v);
        int prev = dist[u] + dist[v] - dist[common]*2;
        int sum2 = getVal(sum[c], target[u]) + getVal(sum[c], target[v]) - 2*getVal(sum[c], target[common]);
        int cnt = getVal(eCount[c], target[u]) + getVal(eCount[c], target[v]) - 2*getVal(eCount[c], target[common]);
 //       cout << prev << " " << sum2 << " " << cnt <<endl;
        cout << prev - sum2 + cnt* newLen <<endl;

    }
}




Measured memory_bytes: 51808