#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const long double eps = 1E-14;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

mint pw(mint a, ll b) {
	if (b == 0) { return 1; }
	mint ret = pw(a, b >> 1);
	ret *= ret;
	if (b & 1) { ret *= a; }
	return ret;
}

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

//////////////////////////////////////
struct LCA {
	vector<vector<edge>> t;
	ll N;
	ll s;

	vector<ll>par;
	vector<ll>dep;
	ll M;//logN

	vector<vector<ll>> anc;

	void dfs(ll v) {
		for (edge e : t[v]) {
			ll w = e.to;
			if (par[w] != -1) { continue; }
			par[w] = v;
			dep[w] = dep[v] + 1;
			dfs(w);
		}
	}

	LCA(vector<vector<edge>>t0, ll N0, ll s0) {
		t = t0;
		N = N0;
		s = s0;

		par.assign(N + 1, -1);
		dep.assign(N + 1, -1);

		par[s] = 0;
		dep[s] = 0;
		dfs(s);

		M = 1;
		for (ll i = 1; i < N; i *= 2) {
			M++;
		}

		anc.assign(N + 1, vector<ll>(M, 0));

		repn(i, N) anc[i][0] = par[i];

		repn(j, M - 1)repn(i, N) anc[i][j] = anc[anc[i][j - 1]][j - 1];


	}

	ll lca(ll u, ll v) {

		if (dep[u] > dep[v]) { swap(u, v); }


		rep(k, M) {
			if ((dep[v] - dep[u]) >> k & 1) { v = anc[v][k]; }
		}

		if (u == v) { return u; }

		for (ll k = M - 1; k >= 0; k--) {
			if (anc[u][k] != anc[v][k]) { u = anc[u][k]; v = anc[v][k]; }
		}

		return par[u];
	}

};

ll N, Q;
vector<vector<edge>> g;
set<pair<ll, ll>> st;
vvll lis;
map<pair<ll, ll>, ll> num, len;
vll slen;

vll nowlen;
vll nownum;
ll nowslen;

void dfs(ll u, ll v) {
	//cout << u << " " << v << " " << nowslen << endl;
	slen[v] = nowslen;
	for (ll x : lis[v]) {
		//cout << x << endl;
		num[{v, x}] = nownum[x];
		len[{v, x}] = nowlen[x];
	}

	for (edge e : g[v]) {
		//cout << e.to << endl;
		ll w = e.to;
		if (u == w) { continue; }

		nownum[e.ind] += 1;
		nowlen[e.ind] += e.d;
		nowslen += e.d;

		dfs(v, w);

		nownum[e.ind] -= 1;
		nowlen[e.ind] -= e.d;
		nowslen -= e.d;
		
	}
}

ll calc(ll x, ll y, ll v) {
	ll ans = slen[v] - len[{v, x}] + y * num[{v, x}];
	return ans;
}

int main() {
	cin >> N >> Q;

	g.resize(N + 1);
	repn(i, N - 1) {
		ll a, b, c, d;
		cin >> a >> b >> c >> d;
		g[a].push_back({ c,a,b,d });
		g[b].push_back({ c,b,a,d });
	}
	LCA lca_g(g, N, 1);
	
	vll x(Q + 1), y(Q + 1), u(Q + 1), v(Q + 1);
	lis.resize(N + 1);
	repn(i, Q) {
		cin >> x[i] >> y[i] >> u[i] >> v[i];
		lis[u[i]].push_back(x[i]);
		lis[v[i]].push_back(x[i]);
		lis[lca_g.lca(u[i], v[i])].push_back(x[i]);
	}

	
	slen.assign(N + 1,0);
	nowlen.assign(N + 1,0);
	nownum.assign(N + 1, 0);
	nowslen = 0;

	dfs(0, 1);
	//repn(v, N)cout << slen[v] << endl;

	
	repn(i, Q) {
		//cout << calc(x[i], y[i], u[i]) << " ";
		//cout << calc(x[i], y[i], v[i]) << " ";
		//cout << calc(x[i], y[i], lca_g.lca(u[i], v[i])) << endl;

		ll ans = calc(x[i], y[i], u[i]) + calc(x[i], y[i], v[i]) - 2*calc(x[i], y[i], lca_g.lca(u[i], v[i]));
		cout << ans << endl;
	}
}

Measured memory_bytes: 90944