#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,tes,t,i,j,jm[100009],raod[100009],n,msh[100009][19],lc,tim,lf[100009],rg[100009],dep[100009],x,y;
pair <long long, long long> mas[100009][3];
vector <pair <long long, pair <long long, long long> > > v[100009];
pair <pair <long long, long long>, pair <long long, long long> > p[100009];
vector <pair <long long, pair <long long, long long> > > g[100009];
void dfsst(long long q, long long w){
	tim++;
	lf[q]=rg[q]=tim;
	msh[q][0]=w;
	for(i=1; i<=18; i++) msh[q][i]=msh[msh[q][i-1]][i-1];
	for(vector <pair <long long, pair <long long, long long> > >::iterator it=v[q].begin(); it!=v[q].end(); it++){
		if((*it).first==w) continue;
		dep[(*it).first]=dep[q]+(*it).second.second;
		dfsst((*it).first,q);
		if(rg[q]<rg[(*it).first]) rg[q]=rg[(*it).first];
	}
}
bool anc(long long q, long long w){
	if(lf[q]<=lf[w]&&rg[q]>=rg[w]) return 1; else return 0;
}
long long lca(long long q, long long w){
	if(anc(q,w)) return q;
	if(anc(w,q)) return w;
	for(long long h=18; h>=0; h--){
		if(msh[q][h]!=0&&anc(msh[q][h],w)==0) q=msh[q][h];
	}
	return msh[q][0];
}
void dfs(long long q, long long w){
	for(long long h=0; h<g[q].size(); h++){
		mas[g[q][h].second.first][g[q][h].second.second].first=raod[g[q][h].first];
		mas[g[q][h].second.first][g[q][h].second.second].second=jm[g[q][h].first];
	}
	for(vector <pair <long long, pair <long long, long long> > >::iterator it=v[q].begin(); it!=v[q].end(); it++){
		if((*it).first==w) continue;
		jm[(*it).second.first]+=(*it).second.second;
		raod[(*it).second.first]++;
		dfs((*it).first,q);
		jm[(*it).second.first]-=(*it).second.second;
		raod[(*it).second.first]--;
	}
}
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>tes;
	for(i=1; i<n; i++){
		cin>>a>>b>>c>>d;
		v[a].push_back(make_pair(b,make_pair(c,d)));
		v[b].push_back(make_pair(a,make_pair(c,d)));
	}
	dfsst(1,0);
	for(t=1; t<=tes; t++){
		cin>>p[t].first.first>>p[t].first.second>>p[t].second.first>>p[t].second.second;
		lc=lca(p[t].second.first,p[t].second.second);
		g[lc].push_back(make_pair(p[t].first.first,make_pair(t,2)));
		g[p[t].second.first].push_back(make_pair(p[t].first.first,make_pair(t,1)));
		g[p[t].second.second].push_back(make_pair(p[t].first.first,make_pair(t,0)));
	}
	dfs(1,0);
	for(t=1; t<=tes; t++){
		c=mas[t][0].first+mas[t][1].first-mas[t][2].first*2;
		d=mas[t][0].second+mas[t][1].second-mas[t][2].second*2;
      y=p[t].first.second;
		cout<<dep[p[t].second.first]+dep[p[t].second.second]-dep[lca(p[t].second.first,p[t].second.second)]*2-d+y*c<<endl;
	}
	return 0;
}