#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define ll long long
#define eps LDBL_EPSILON
#define mod (ll)1000000007
#define INF LLONG_MAX/10
#define P pair<int,int>
#define prique priority_queue
using namespace std;
int gcd(int a, int b) {
	if (!b)return a;
	return gcd(b, a % b);
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
int mypow(int a, int b) {
	if (!b)return 1;
	if (b % 2)return mypow(a, b - 1) * a;
	int memo = mypow(a, b / 2);
	return memo * memo;
}
int modpow(int a, int b, int m = mod) {
	if (!b)return 1;
	if (b % 2)return modpow(a, b - 1, m) * a % m;
	int memo = modpow(a, b / 2, m);
	return memo * memo % m;
}
class UnionFind {
	int* par, * rank;
	P* notparent;
	vector<P>* size;
	int opcount = 0;
public:
	UnionFind(int size) {
		par = new int[size + 1];
		rank = new int[size + 1];
		this->size = new vector<P>[size + 1];
		notparent = new P[size + 1];
		rep(i, size + 1) {
			par[i] = i;
			rank[i] = 0;
			this->size[i].push_back(make_pair(-1, 1));
			notparent[i] = make_pair(INF, i);
		}
	}
	int find(int n, int t = INF) {
		if (opcount <= t) {
			if (par[n] == n)return n;
			return par[n] = find(par[n]);
		}
		if (notparent[n].first <= t)return find(notparent[n].second, t);
		return n;
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m) {
			opcount++;
			return;
		}
		if (rank[n] < rank[m]) {
			par[n] = m;
			notparent[n] = make_pair(opcount, m);
			size[m].push_back(make_pair(opcount, size[m].back().second + size[n].back().second));
		}
		else {
			par[m] = n;
			notparent[m] = make_pair(opcount, n);
			size[n].push_back(make_pair(opcount, size[n].back().second + size[m].back().second));
			if (rank[n] == rank[m])rank[n]++;
		}
		opcount++;
	}
	bool same(int n, int m, int t = INF) {
		return find(n, t) == find(m, t);
	}
	int getsize(int n, int t = INF) {
		n = find(n, t);
		auto ite = lower_bound(size[n].begin(), size[n].end(), make_pair(t, (ll)0));
		if (ite == size[n].end())ite--;
		if (t < (*ite).first)ite--;
		return (*ite).second;
	}
};
class RollingHash {
	string s;
	int n, m, base;
	int* has;
	int mypow(int x, int y) {
		if (!y)return 1;
		if (y % 2)return this->mypow(x, y - 1) * x % m;
		int memo = this->mypow(x, y / 2);
		return memo * memo % m;
	}
public:
	RollingHash(string s, int m, int b): n(s.size()), m(m), base(b) { init(s, m, b); }
	~RollingHash() { delete[] has; }
	void init(string s, int m, int b) {
		n = s.size();
		has = new int[n];
		base = b;
		this->s = s;
		this->m = m;
		rep(i, n) {
			has[i] = (int)s[i];
			if (i)has[i] += base * has[i - 1] % m;
			has[i] %= m;
		}
	}
	int query(int a, int b) {
		assert(!(a >= b || a < 0 || n < b));
		return (has[b - 1] - this->mypow(base, b - a) * (!a ? 0 : has[a - 1]) % m + m) % m;
	}
};
class mycomplex {
	double realvalue, imagvalue;
public:
	mycomplex() :realvalue(0), imagvalue(0) {}
	mycomplex(double realvalue, double imagvalue) : realvalue(realvalue), imagvalue(imagvalue) {}
	mycomplex(double realvalue) : realvalue(realvalue), imagvalue(0) {}
	mycomplex(complex<double> c) :realvalue(c.real()), imagvalue(c.imag()) {}
	mycomplex(const mycomplex& rhs) :realvalue(rhs.realvalue), imagvalue(rhs.imagvalue) {}
	double real()const { return this->realvalue; }
	double imag()const { return this->imagvalue; }
	double abs() { return hypot(realvalue, imagvalue); }
	mycomplex& operator=(const mycomplex& obj) {
		if (this != &obj) {
			this->realvalue = obj.realvalue;
			this->imagvalue = obj.imagvalue;
		}
		return *this;
	}
	mycomplex& operator=(mycomplex&& obj)noexcept {
		if (this != &obj) {
			this->realvalue = exchange(obj.realvalue, 0);
			this->imagvalue = exchange(obj.imagvalue, 0);
		}
		return *this;
	}
	mycomplex& operator+=(const mycomplex& rhs) {
		this->realvalue += rhs.realvalue;
		this->imagvalue += rhs.imagvalue;
		return *this;
	}
	friend mycomplex operator+(mycomplex lhs, const mycomplex& rhs) {
		lhs += rhs;
		return lhs;
	}
	mycomplex& operator-=(const mycomplex& rhs) {
		this->realvalue -= rhs.realvalue;
		this->imagvalue -= rhs.imagvalue;
		return *this;
	}
	mycomplex& operator-=(const double& rhs) {
		this->realvalue -= rhs;
		return *this;
	}
	friend mycomplex operator-(mycomplex lhs, const mycomplex& rhs) {
		lhs -= rhs;
		return lhs;
	}
	mycomplex& operator*=(const mycomplex& rhs) {
		double pastreal = this->realvalue;
		this->realvalue = this->realvalue * rhs.realvalue - this->imagvalue * rhs.imagvalue;
		this->imagvalue = pastreal * rhs.imagvalue + rhs.realvalue * this->imagvalue;
		return *this;
	}
	friend mycomplex operator*(mycomplex lhs, const mycomplex& rhs) {
		lhs *= rhs;
		return lhs;
	}
	mycomplex& operator/=(const mycomplex& rhs) {
		*this *= mycomplex(rhs.real(), -rhs.imag());
		double dnm = rhs.real() * rhs.real() - rhs.imag() * rhs.imag();
		this->realvalue /= dnm;
		this->imagvalue /= dnm;
		return *this;
	}
	friend mycomplex operator/(mycomplex lhs, const mycomplex& rhs) {
		lhs /= rhs;
		return lhs;
	}
};
class FastFourierTransform {
private:
	static void dft(vector<mycomplex>& func, int inverse) {
		int sz = func.size();
		if (sz == 1)return;
		vector<mycomplex> veca, vecb;
		rep(i, sz / 2) {
			veca.push_back(func[2 * i]);
			vecb.push_back(func[2 * i + 1]);
		}
		dft(veca, inverse); dft(vecb, inverse);
		mycomplex now = 1, zeta = polar(1.0, inverse * 2.0 * acos(-1) / sz);
		rep(i, sz) {
			func[i] = veca[i % (sz / 2)] + now * vecb[i % (sz / 2)];
			now *= zeta;
		}
	}
public:
	template<typename T>
	static vector<double> multiply(vector<T> f, vector<T> g) {
		vector<mycomplex> nf, ng;
		int sz = 1;
		while (sz < f.size() + g.size())sz *= 2;
		nf.resize(sz); ng.resize(sz);
		rep(i, f.size()) {
			nf[i] = f[i];
			ng[i] = g[i];
		}
		dft(nf, 1);
		dft(ng, 1);
		rep(i, sz)nf[i] *= ng[i];
		dft(nf, -1);
		vector<double> res;
		rep(i, sz)res.push_back(nf[i].real() / sz);
		return res;
	}
};
class SegTree {
	int size;
	P *node, *lazy;
	bool *lazyflag;
public:
	SegTree(int n_) {
		init(n_);
	}
	SegTree() {}
	~SegTree() {
		delete[] node;
		delete[] lazy;
		delete[] lazyflag;
	}
	void init(int n_) {
		size = 1;
		while (size < n_)size *= 2;
		node = new P[2 * size];
		lazy = new P[2 * size];
		lazyflag = new bool[2 * size];
		rep(i, 2 * size)node[i] = make_pair(INF, -1);
		fill(lazyflag, lazyflag + 2 * size, false);
	}
	void eval(int k, int l, int r) {
		if (lazyflag[k]) {
			node[k] = lazy[k];
			if (r - l > 1) {
				lazy[k * 2 + 1] = lazy[k * 2 + 2] = lazy[k];
				lazyflag[k * 2 + 1] = lazyflag[k * 2 + 2] = true;
			}
			lazyflag[k] = false;
		}
	}
	void update(int a, int b, P x, int k = 0, int l = 0, int r = -1) {
		if (r < 0)r = size;
		eval(k, l, r);
		if (b <= l || r <= a)return;
		if (a <= l && r <= b) {
			lazy[k] = x;
			lazyflag[k] = true;
			eval(k, l, r);
		}
		else {
			update(a, b, x, 2 * k + 1, l, (l + r) / 2);
			update(a, b, x, 2 * k + 2, (l + r) / 2, r);
			node[k] = min(node[2 * k + 1], node[2 * k + 2]);
		}
	}
	P query(int a, int b, int k = 0, int l = 0, int r = -1) {
		if (r < 0)r = size;
		eval(k, l, r);
		if (b <= l || r <= a)return make_pair(INF, -1);
		if (a <= l && r <= b)return node[k];
		P vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
		P vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
};
int n, q, a, b, c, d, x[100010], y[100010], u[100010], v[100010];
vector<pair<int,P>> vec[100010];
vector<pair<P, bool>> queries[100010];
vector<int> tour, depth;
int id[100010], ans[2][100010], num[100010], dist[100010], length[100010];
bool used[100010];
void eulertour(int node, int dep) {
	used[node] = true;
	tour.push_back(node);
	depth.push_back(dep);
	for (pair<int, P> p : vec[node]) {
		if (!used[p.first]) {
			eulertour(p.first, dep + 1);
			tour.push_back(node);
			depth.push_back(dep);
		}
	}
}
void dfs(int node, int d) {
	used[node] = true;
	dist[node] = d;
	for (pair<P, bool> p : queries[node]) {
		if (p.second) {
			ans[0][p.first.second] += num[p.first.first];
			ans[1][p.first.second] += length[p.first.first];
		}
		else {
			ans[0][p.first.second] -= num[p.first.first] * 2;
			ans[1][p.first.second] -= length[p.first.first] * 2;
		}
	}
	for (pair<int, P> p : vec[node]) {
		if (!used[p.first]) {
			num[p.second.first]++;
			length[p.second.first] += p.second.second;
			dfs(p.first, d + p.second.second);
			num[p.second.first]--;
			length[p.second.first] -= p.second.second;
		}
	}
}
signed main() {
	cin >> n >> q;
	rep(i, n - 1) {
		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)));
	}
	eulertour(1, 0);
	SegTree st((int)tour.size() + 1);
	rep(i, tour.size()) {
		st.update(i, i + 1, make_pair(depth[i], tour[i]));
		if (!id[tour[i]])id[tour[i]] = i;
	}
	rep(i, q) {
		cin >> x[i] >> y[i] >> u[i] >> v[i];
		queries[u[i]].push_back(make_pair(make_pair(x[i], i), true));
		queries[v[i]].push_back(make_pair(make_pair(x[i], i), true));
		queries[st.query(min(id[u[i]], id[v[i]]), max(id[u[i]], id[v[i]]) + 1).second].push_back(make_pair(make_pair(x[i], i), false));
	}
	fill(used + 1, used + n + 1, false);
	dfs(1, 0);
	rep(i, q) {
		int cnt = 0;
		cnt += dist[u[i]] + dist[v[i]];
		cnt -= 2 * dist[st.query(min(id[u[i]], id[v[i]]), max(id[u[i]], id[v[i]]) + 1).second];
		cnt -= ans[1][i];
		cnt += y[i] * ans[0][i];
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 53048