#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,q,x,y,c,d,depth[100010],num[100010],sum[100010],ans[100010];
int par[20][100010];
vector <int> g[100010];
vector <pair <pii,int> > g2[100010];
vector <pair <pii,pii> > v[100010];

void dfs(int pos,int no,int d)
{
	depth[pos]=d;
	par[0][pos]=no;
	rep(i,g[pos].size()) if(g[pos][i]!=no) dfs(g[pos][i],pos,d+1);
}

int lca(int pos1,int pos2)
{
	if(depth[pos1]<depth[pos2]) swap(pos1,pos2);
	for(int i=18;i>=0;i--) if(depth[pos1]-(int)pow(2,i)>=depth[pos2]) pos1=par[i][pos1];
	for(int i=18;i>=0;i--)
	{
		if(par[i][pos1]!=par[i][pos2])
		{
			pos1=par[i][pos1];
			pos2=par[i][pos2];
		}
	}
	if(pos1==pos2) return pos1;
	return par[0][pos1];
}

void dfs2(int pos,int no,int d)
{
	rep(i,v[pos].size())
	{
		if(v[pos][i].fi.se==1) ans[v[pos][i].fi.fi]+=d-sum[v[pos][i].se.fi]+num[v[pos][i].se.fi]*v[pos][i].se.se;
		else ans[v[pos][i].fi.fi]-=(d-sum[v[pos][i].se.fi]+num[v[pos][i].se.fi]*v[pos][i].se.se)*2;
	}
	rep(i,g2[pos].size())
	{
		if(g2[pos][i].fi.fi==no) continue;
		num[g2[pos][i].fi.se]++;
		sum[g2[pos][i].fi.se]+=g2[pos][i].se;
		dfs2(g2[pos][i].fi.fi,pos,d+g2[pos][i].se);
		num[g2[pos][i].fi.se]--;
		sum[g2[pos][i].fi.se]-=g2[pos][i].se;
	}
}

int main()
{
	cin>>n>>q;
	rep(i,n-1)
	{
		scanf("%d%d%d%d",&x,&y,&c,&d);
		g[x].pb(y);
		g[y].pb(x);
		g2[x].pb(mpr(mpr(y,c),d));
		g2[y].pb(mpr(mpr(x,c),d));
	}
	rep(i,20) rep(j,100005) par[i][j]=-1;
	dfs(1,-1,0);
	rep(i,18)
	{
		repn(j,n)
		{
			if(par[i][j]==-1) continue;
			par[i+1][j]=par[i][par[i][j]];
		}
	}
	rep(qn,q)
	{
		scanf("%d%d%d%d",&c,&d,&x,&y);
		int z=lca(x,y);
		v[x].pb(mpr(mpr(qn,1),mpr(c,d)));
		v[y].pb(mpr(mpr(qn,1),mpr(c,d)));
		v[z].pb(mpr(mpr(qn,-1),mpr(c,d)));
	}
	dfs2(1,0,0);
	rep(i,q) cout<<ans[i]<<endl;
	return 0;
}