#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define int long long
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n, q;
int pp[100010][20];
vector<pair<int, P>> vec[100010];
vector<pair<P, P>> ve[100010];
int d[100010];
int dd[100010];
int ans[100010];
int k[100010], cnt[100010];

void dfs(int v, int p, int k) {
	pp[v][0] = p;
	d[v] = k;
	for (int i = 0; i < (int)vec[v].size(); i++) {
		if (vec[v][i].first == p)continue;
		dd[vec[v][i].first] = dd[v] + vec[v][i].second.second;
		dfs(vec[v][i].first, v, k + 1);
	}
}

int senzo(int v, int k) {
	for (int i = 0; i <= 16; i++)if (k&(1 << i))v = pp[v][i];
	return v;
}

int LCA(int x, int y) {
	if (d[x] < d[y])y = senzo(y, d[y] - d[x]);
	if (d[y] < d[x])x = senzo(x, d[x] - d[y]);
	int mi = -1, ma = n;
	while (ma - mi > 1) {
		int md = (mi + ma) / 2;
		if (senzo(x, md) == senzo(y, md))ma = md;
		else mi = md;
	}
	return senzo(x, ma);
}

void dfs2(int v, int p) {
	for (int i = 0; i < (int)ve[v].size(); i++) {
		if (ve[v][i].first.first == 0) {
			ans[ve[v][i].first.second] += 2 * cnt[ve[v][i].second.first];
			ans[ve[v][i].first.second] -= 2 * ve[v][i].second.second*k[ve[v][i].second.first];
		}
		else {
			ans[ve[v][i].first.second] -= cnt[ve[v][i].second.first];
			ans[ve[v][i].first.second] += ve[v][i].second.second*k[ve[v][i].second.first];
		}
	}
	for (int i = 0; i < (int)vec[v].size(); i++) {
		if (vec[v][i].first == p)continue;
		k[vec[v][i].second.first]++;
		cnt[vec[v][i].second.first] += vec[v][i].second.second;
		dfs2(vec[v][i].first, v);
		k[vec[v][i].second.first]--;
		cnt[vec[v][i].second.first] -= vec[v][i].second.second;
	}
}

signed main() {
	cin >> n >> q;
	for (int i = 1; i < n; i++) {
		int a, b, c, d; cin >> a >> b >> c >> d;
		vec[a].push_back(make_pair(b, make_pair(c, d)));
		vec[b].push_back(make_pair(a, make_pair(c, d)));
	}
	dfs(1, 0, 0);
	for (int j = 1; j <= 16; j++)for (int i = 1; i <= n; i++)pp[i][j] = pp[pp[i][j - 1]][j - 1];
	for (int i = 0; i < q; i++) {
		int x, y, u, v; cin >> x >> y >> u >> v;
		int p = LCA(u, v);
		ans[i] = dd[u] + dd[v] - 2 * dd[p];
		ve[u].push_back(make_pair(make_pair(1, i), make_pair(x, y)));
		ve[v].push_back(make_pair(make_pair(1, i), make_pair(x, y)));
		ve[p].push_back(make_pair(make_pair(0, i), make_pair(x, y)));
	}
	dfs2(1, 0);
	for (int i = 0; i < q; i++)cout << ans[i] << endl;
}


Measured memory_bytes: 50160