#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

//蟻本p293
/*
verified by
http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=4090869#1
https://atcoder.jp/contests/past201912-open/submissions/9324604
*/
struct LCA{
private:
	vector<vector<int>> v;
	vector<vector<int>> parent;
	vector<int> depth;
	int h = 0;
	void dfs(int n,int m,int d){
		parent[0][n] = m;
		depth[n] = d;
		for(auto x:v[n]){
			if(x!=m) dfs(x,n,d+1);
		}
	}
public:
	LCA(int N,int root,vector<vector<int>>& tree){
		while((1<<h)<=N) h++;
		v = tree;
		parent = vector<vector<int>>(h,vector<int>(N,0));
		depth = vector<int>(N,0);
		dfs(root,-1,0);
		for(int j=0;j+1<h;j++){
			for(int i=0;i<N;i++){
				if(parent[j][i]<0) parent[j+1][i] = -1;
				else parent[j+1][i] = parent[j][parent[j][i]];
			}
		}
	}
	int lca(int n,int m){
		if(depth[n]>depth[m]) swap(n,m);
		for(int j=0;j<h;j++){
			if((depth[m]-depth[n]) >> j&1) m = parent[j][m];
		}
		if(n==m) return n;
		for(int j=h-1;j>=0;j--){
			if(parent[j][n]!=parent[j][m]){
				n = parent[j][n];
				m = parent[j][m];
			}
		}
		return parent[0][n];
	}
	int dep(int n){return depth[n];}
};

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n,q;
	cin>>n>>q;
	struct edge{int to,c,d;};
	struct query{
		int id,c,val;
		bool flag;
	};
	vector<vector<edge>> g(n);
	vector<vector<int>> tree(n);
	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});
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	LCA lca(n,0,tree);
	vector<vector<query>> que(n);
	rep(i,q){
		int x,y,u,v;
		cin>>x>>y>>u>>v;
		u--,v--;
		int r=lca.lca(u,v);
		que[u].push_back({i,x,y,false});
		que[v].push_back({i,x,y,false});
		que[r].push_back({i,x,y,true});
	}
	vector<int> num(n,0),sum(n,0),ans(q);
	auto dfs=[&](auto &dfs,int v,int pre,int d)->void{
		for(auto now:que[v]){
			int dist=d+num[now.c]*now.val-sum[now.c];
			if(now.flag){
				ans[now.id]-=2*dist;
			}else{
				ans[now.id]+=dist;
			}
		}
		for(auto to:g[v]){
			if(to.to==pre) continue;
			num[to.c]++;
			sum[to.c]+=to.d;
			dfs(dfs,to.to,v,d+to.d);
			num[to.c]--;
			sum[to.c]-=to.d;
		}
	};
	dfs(dfs,0,-1,0);
	cout<<ans<<endl;
}

Measured memory_bytes: 38388