/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

struct edge{
    int to, c, d;
};

int n, q;
vector<vector<edge>> g;
vector<int> x, y, u, v;

int parent[20][100100];
int depth[100100];

void dfs(int v, int p, int d) {
    parent[0][v] = p;
    depth[v] = d;
    rep(i, (int)g[v].size()) {
        if(g[v][i].to == p) continue;
        dfs(g[v][i].to, v, d + 1);
    }
}

int lca(int u, int v) {
    if(depth[u] > depth[v]) swap(u, v);
    rep(k, 20) {
        if((depth[v] - depth[u]) >> k & 1) {
            v = parent[k][v];
        }
    }
    if(u == v) return u;
    for(int k = 20 - 1; k >= 0; -- k) {
        if(parent[k][u] != parent[k][v]) {
            u = parent[k][u];
            v = parent[k][v];
        }
    }
    return parent[0][u];
}

vector<int> cols[100100];

vector<int> cnt, cnt1;
vector<int> de;
map<P, int> mp, mp1;

void ddfs(int v, int p, int d) {
    rep(i, (int)cols[v].size()) {
        mp[{v, cols[v][i]}] = cnt[cols[v][i]];
        mp1[{v, cols[v][i]}] = cnt1[cols[v][i]];
    }
    // rep(i, n) {
    //     cerr << cnt[i] << " ";
    // }
    // cerr << endl;
    de[v] = d;
    for(auto e: g[v]) {
        if(e.to == p) continue;
        cnt[e.c] += e.d;
        cnt1[e.c] ++;
        //cerr << e.c << endl;
        ddfs(e.to, v, d + e.d);
        cnt[e.c] -= e.d;
        cnt1[e.c] --;
    }
}

void solve() {
	cin >> n >> q;
    g.assign(n, vector<edge>());
    rep(i, n - 1) {
        int a, b, c, d; cin >> a >> b >> c >> d;
        --a, --b;
        g[a].push_back({b, c, d});
        g[b].push_back({a, c, d});
    }
    dfs(0, -1, 0);
    for(int k = 0; k + 1 < 20; ++ k) {
        rep(i, n) {
            if(parent[k][i] < 0) parent[k + 1][i] = -1;
            else parent[k + 1][i] = parent[k][parent[k][i]];
        }
    }
    x.resize(q); y.resize(q);
    u.resize(q); v.resize(q);
    vector<int> l(q);
    rep(i, q) {
        cin >> x[i] >> y[i] >> u[i] >> v[i];
        -- u[i], --v[i];
        l[i] = lca(u[i], v[i]);
        //cerr << l[i] << endl;
        cols[u[i]].push_back(x[i]);
        cols[v[i]].push_back(x[i]);
        cols[l[i]].push_back(x[i]);
    }
    cnt.assign(n, 0);
    cnt1.assign(n, 0);
    de.resize(n, 0);
    ddfs(0, -1, 0);
    rep(i, q) {
        //cerr << mp[{v[i], x[i]}] << " " <<  y[i] * mp1[{v[i], x[i]}] << endl;
        int ans = de[v[i]] - mp[{v[i], x[i]}] + y[i] * mp1[{v[i], x[i]}];
        ans += de[u[i]] - mp[{u[i], x[i]}] + y[i] * mp1[{u[i], x[i]}];
        ans -= 2 * (de[l[i]] - mp[{l[i], x[i]}] + y[i] * mp1[{l[i], x[i]}]);
        cout << ans << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 57912