#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, max_m = 1000011, inf = 1000111222;
const ll inff = 1000111222333444;
const int mod = 1000000007;

int n, m, p[30][max_n], tin[max_n], tout[max_n], t, ans[max_n];
int sum[max_n], cnt[max_n];
vector<pair<int, pair<int, int> > > v[max_n];
pair<pair<int, int>, pair<int, int> > qrs[max_n];
vector<int> qs[max_n];

void dfs(int x, int pp) {
    tin[x] = tout[x] = t++;
    p[0][x] = pp;
    for (int i = 1; i < 30; ++i) {
        p[i][x] = p[i - 1][x] == -1 ? -1 : p[i - 1][p[i - 1][x]];
    }
    for (auto xx : v[x]) {
        int to = xx.F;
        if (to == pp) continue;
        dfs(to, x);
        tout[x] = tout[to];
    }
}

bool is_anc(int x, int p) {
    assert(x >= 0 && p >= 0);
    return tin[p] <= tin[x] && tout[p] >= tout[x];
}

int lca(int x, int y) {
    if (is_anc(x, y)) return y;
    if (is_anc(y, x)) return x;
    for (int i = 29; i >= 0; --i) {
        if (p[i][x] != -1 && !is_anc(y, p[i][x]))
            x = p[i][x];
    }
    return p[0][x];
}

void read() {
    cin >> n >> m;
    for (int i = 1; i < n; ++i) {
        int f, g, h, j;
        scanf("%d%d%d%d", &f, &g, &h, &j);
        --f; --g;
        v[f].push_back({g, {h, j}});
        v[g].push_back({f, {h, j}});
    }
    for (int i = 0; i < m; ++i) {
        int f, g, h, j;
        scanf("%d%d%d%d", &f, &g, &h, &j);
        --j; --h;
        qrs[i] = {{f, g}, {h, j}};
    }
}

void rnd() {
    n = 5;
    m = 10;
    int max_c = 3;
    int max_d = 5;
    for (int i = 1; i < n; ++i) {
        int p = rand() % i;
        int c = rand() % max_c;
        int d = rand() % max_d + 1;
        v[p].push_back({i, {c, d}});
        v[i].push_back({p, {c, d}});
        cout << p << " " << i << " " << c << " " << d << endl;
    } cout << endl;
    for (int q = 0; q < m; ++q) {
        int x = rand() % n;
        int y = rand() % n;
        int c = rand() % max_c;
        int d = rand() % max_d + 1;
        qrs[q] = {{c, d}, {x, y}};
        cout << c << " " << d << " " << x << " " << y << endl;
    }
}

int get_dist(int x, int q, int dist) {
    //cout << "get dist x=" << x << ", q=" << q << " = " << dist - sum[qrs[q].F.F] + cnt[qrs[q].F.F] * qrs[q].F.S << endl;
    return dist - sum[qrs[q].F.F] + cnt[qrs[q].F.F] * qrs[q].F.S;
}

void get_answers(int x, int p, int dist) {
    for (int q : qs[x]) {
        if (x == qrs[q].S.F || x == qrs[q].S.S) {
            if (x == qrs[q].S.F) qrs[q].S.F = -1; else qrs[q].S.S = -1;
            ans[q] += get_dist(x, q, dist);
        } else {
            ans[q] -= 2 * get_dist(x, q, dist);
        }
    }
    for (auto g : v[x]) {
        if (g.F == p) continue;
        sum[g.S.F] += g.S.S;
        ++cnt[g.S.F];
        get_answers(g.F, x, dist + g.S.S);
        sum[g.S.F] -= g.S.S;
        --cnt[g.S.F];
    }
}

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 == p) continue;
        int new_dist = dist + aa.S.S;
        if (aa.S.F == qrs[q].F.F) {
            new_dist = new_dist - aa.S.S + qrs[q].F.S;
        }
        int g = op_qr(aa.F, x, new_dist, y, q);
        if (g != -1) return g;
    }
    return -1;
}

bool check() {
    for (int i = 0; i < m; ++i) {
        /*if (op_qr(qrss[i].S.F, -1, 0, qrss[i].S.S, i) != ans[i]) {
            cout << "check i=" << i << ", real=" << op_qr(qrss[i].S.F, -1, 0, qrss[i].S.S, i) << ", ans=" << ans[i] << endl;
            return false;
        }*/
    }
    return true;
}

int main() {
    srand(time(0));
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    read();
    //rnd();
    dfs(0, -1);
    for (int i = 0; i < m; ++i) {
        qs[qrs[i].S.F].push_back(i);
        qs[qrs[i].S.S].push_back(i);
        qs[lca(qrs[i].S.F, qrs[i].S.S)].push_back(i);
    }
    get_answers(0, -1, 0);
    //assert(check());
    for (int i = 0; i < m; ++i) {
        printf("%d\n", ans[i]);
    }
    return 0;
}


Measured memory_bytes: 32764