#include <bits/stdc++.h>

#define F first
#define S second

using namespace std;
typedef long double ld;
typedef long long ll;

const int max_n = 100011, inf = 1000111222;
const ll inff = 1000111222333444;

int n, k, p[max_n], t, num[max_n], ptr[max_n], p_ind[max_n];
vector<pair<pair<int, int>, pair<int, int> > > v[max_n];
pair<int, int> par[max_n];
vector<int> ord;
pair<int, pair<pair<int, int>, pair<int, int> > > qr[max_n];

void init_dfs(int x, int pp) {
    p[x] = pp;
    ptr[x] = ord.size();
    num[x] = t++;
    ord.push_back(x);
    for (int i = 0; i < v[x].size(); ++i) {
        int to = v[x][i].F.F;
        if (to == pp) {
            p_ind[x] = v[x][i].F.S;
            continue;
        }
        init_dfs(to, x);
        par[to] = v[x][i].S;
        ord.push_back(x);
    }
}

int sz = 500;
bool cmp(const pair<int, pair<pair<int, int>, pair<int, int> > >& a, const pair<int, pair<pair<int, int>, pair<int, int> > >& b) {
    if (ptr[a.S.S.F] / sz != ptr[b.S.S.F] / sz) {
        return ptr[a.S.S.F] < ptr[b.S.S.F];
    }
    return ptr[a.S.S.S] > ptr[b.S.S.S];
}

int edges[max_n];
ll c_sum[max_n], c_cnt[max_n];
ll all = 0;
set<pair<int, int> > st;
void update(int x, int y, int add = 1) {
    x = ord[x];
    y = ord[y];
    if (x == y) return;
    // cout << "update x=" << x << ", y=" << y << ", mul=" << add << endl;
    if (p[x] == y) {
        // add *= -1;
        swap(x, y);
    }
    if (edges[p_ind[y]]) {
        add = -1;
    }
    edges[p_ind[y]] ^= 1;
    // assert(p[y] == x);
    all += add * par[y].S;
    c_sum[par[y].F] += add * par[y].S;
    c_cnt[par[y].F] += add;
}

int op_qr(int x, int p, int dist, int y, int q) {
    if (x == y) return dist;
    for (auto aa : v[x]) {
        if (aa.F.F == p) continue;
        int new_dist = dist + aa.S.S;
        if (aa.S.F == qr[q].S.F.F) {
            new_dist = new_dist - aa.S.S + qr[q].S.F.S;
        }
        int g = op_qr(aa.F.F, x, new_dist, y, q);
        if (g != -1) return g;
    }
    return -1;
}

bool check(const vector<pair<ll, ll> >& ans) {
    for (int i = 0; i < k; ++i) {
        if (op_qr(qr[i].S.S.F, -1, 0, qr[i].S.S.S, i) != ans[qr[i].F].S) {
            cout << "check i=" << qr[i].F << ", real=" << op_qr(qr[i].S.S.F, -1, 0, qr[i].S.S.S, i) << ", ans=" << ans[qr[i].F].S << endl;
            return false;
        }
    }
    return true;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    n = k = 100000;
    cin >> n >> k;
    bool debug = false;
    const int max_c = 3;
    const int max_d = 5;
    for (int i = 1; i < n; ++i) {
        int x, y, g, h;
        if (!debug) {
            scanf("%d%d%d%d", &x, &y, &g, &h);
            --x; --y;
        } else {
            x = i;
            y = rand() % i;
            g = rand() % max_c + 1;
            h = rand() % max_d + 1;
            // cout << x + 1 << " " << y + 1 << " " << g << " " << h << endl;
        }
        v[x].push_back({{y, i}, {g, h}});
        v[y].push_back({{x, i}, {g, h}});
    }
    init_dfs(0, -1);
    if (debug) cout << endl;
    for (int i = 0; i < k; ++i) {
        if (!debug) {
            scanf("%d%d%d%d", &qr[i].S.F.F, &qr[i].S.F.S, &qr[i].S.S.F, &qr[i].S.S.S);
        } else {
            qr[i] = {i, {{rand() % max_c, rand() % max_d}, {rand() % n + 1, rand() % n + 1}}};
            // cout << qr[i].S.F.F << " " << qr[i].S.F.S << " " << qr[i].S.S.F << " " << qr[i].S.S.S << endl;
        }
        qr[i].F = i;
        --qr[i].S.S.F; --qr[i].S.S.S;
        int nl = ptr[qr[i].S.S.F];
        int nr = ptr[qr[i].S.S.S];
        if (nl > nr) swap(qr[i].S.S.F, qr[i].S.S.S);
    }
    sort(qr, qr + k, cmp);
    //for (int i = 0; i < n; ++i) cout << ptr[i] << " "; cout << endl;
    //for (int i = 0; i < ord.size(); ++i) cout << ord[i] << " "; cout << endl;
    //for (int i = 0; i < k; ++i) cout << num[qr[i].S.S.F] << " " << num[qr[i].S.S.S] << "    "; cout << endl;
    vector<pair<ll, ll> > ans;
    int l = 0, r = 0;
    for (int i = 0; i < k; ++i) {
        // if (i % 1000 == 0) cout << i << endl;
        int nl = ptr[qr[i].S.S.F];
        int nr = ptr[qr[i].S.S.S];
        //cout << qr[i].S.S.F << " " << qr[i].S.S.S << " " << nl << " " << nr << endl;
        if (nl > nr) swap(nl, nr);
        while (r < nr) {
            update(r, r + 1, 1);
            ++r;
        }
        while (l > nl) {
            update(l, l - 1, 1);
            --l;
        }
        while (l < nl) {
            update(l, l + 1, 1);
            ++l;
        }
        while (r > nr) {
            update(r, r - 1, 1);
            --r;
        }
        // assert(num[ord[l]] == nl && num[ord[r]] == nr);
        int col = qr[i].S.F.F;
        int new_val = qr[i].S.F.S;
        //cout << "i=" << qr[i].F << ", " << l << " " << r << "     " << col << " " << c_cnt[col] << " " << c_sum[col] << "    " << all << endl;
        /*for (int q = 0; q < 5; ++q) {
            cout << "     " << q << " " << c_cnt[q] << " " << c_sum[q] << endl;
        } cout << "       " << all << endl;*/
        ans.push_back({qr[i].F, all - c_sum[col] + c_cnt[col] * new_val});
    }
    sort(ans.begin(), ans.end());
    //assert(check(ans));
    for (int i = 0; i < ans.size(); ++i) {
        printf("%lld\n", ans[i].S);
    }
    return 0;
}


Measured memory_bytes: 21744