#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

#define MAX_V 200100
#define MAX_LOG_V 20

vector<int> G[MAX_V];
int root;

int parent[MAX_LOG_V][MAX_V];
int depth[MAX_V];

void ae(int from, int to){
  G[from].push_back(to);
  G[to].push_back(from);
}

void dfsl(int v, int p, int d){
  parent[0][v] = p;
  depth[v] = d;
  for(int i = 0; i < G[v].size(); i++){
    if(G[v][i] != p)dfsl(G[v][i],v,d+1);
  }
}

void init(int V){
  dfsl(root,-1,0);
  for(int k = 0; k+1 < MAX_LOG_V; k++){
    for(int v = 0; v < V; v++){
      if(parent[k][v] < 0)parent[k+1][v]=-1;
      else parent[k+1][v] = parent[k][parent[k][v]];
    }
  }
}

int lca(int u, int v){
  if(depth[u] > depth[v])swap(u,v);
  for(int k = 0; k < MAX_LOG_V; k++){
    if((depth[v] - depth[u]) >> k & 1){
      v = parent[k][v];
    }
  }
  if(u == v)return u;
  for(int k = MAX_LOG_V - 1; k >= 0; k--){
    if(parent[k][u] != parent[k][v]){
      u = parent[k][u];
      v = parent[k][v];
    }
  }
  return parent[0][u];
}

ll d1[200100];
ll d2[200100];
ll d3[200100];

vector<vector<pair<ll,pair<ll,ll> > > > vv;
vector<vector<pair<ll,pair<ll,ll> > > > v1;

void dfs(ll a, ll p, ll h){
  d1[a] = h;
  rep(i,0,v1[a].sz){
  	ll b = v1[a][i].fi;
  	v1[a][i].se.fi = d2[b];
  	v1[a][i].se.se = d3[b];
  }
  if(vv[a].sz==1&&p!=-1){
    return;
  }
  rep(i,0,vv[a].sz){
    if(vv[a][i].fi==p)continue;
    ll c = vv[a][i].se.fi;
    ll d = vv[a][i].se.se;
    d2[c]++;
    d3[c]+=d;
    dfs(vv[a][i].fi,a,h+d);
    d2[c]--;
    d3[c]-=d;
  }
  return;
}

void dfs2(ll a, ll p, ll h){
  if(vv[a].sz==1&&p!=-1){
    return;
  }
  rep(i,0,vv[a].sz){
    if(vv[a][i].fi==p)continue;
    ae(a,vv[a][i].fi);
    dfs2(vv[a][i].fi,a,h+1);
  }
  return;
}

int main() {
	clr(d1,0);
	clr(d2,0);
	clr(d3,0);
	ll n,q;
	cin>>n>>q;
	vector<vector<pair<ll,pair<ll,ll> > > > vv_(n,vector<pair<ll,pair<ll,ll> > >());
	vv = vv_;
	rep(i,0,n-1){
		ll a,b,c,d;
		cin>>a>>b>>c>>d;
		a--;b--;
		vv[a].pb(mp(b,mp(c,d)));
		vv[b].pb(mp(a,mp(c,d)));
	}
	root = 0;
	dfs2(0,-1,0);
	init(n);
	vector<pair<pair<ll,ll>,pair<ll,ll> > > vq;
	vector<vector<pair<ll,pair<ll,ll> > > > v1_(n,vector<pair<ll,pair<ll,ll> > >());
	v1 = v1_;
	rep(i,0,q){
		ll a,b,c,d;
		cin>>a>>b>>c>>d;
		c--;d--;
		vq.pb(mp(mp(a,b),mp(c,d)));
		ll e = lca(c,d);
		v1[c].pb(mp(a,mp(0,0)));
		v1[d].pb(mp(a,mp(0,0)));
		v1[e].pb(mp(a,mp(0,0)));
	}
	dfs(0,-1,0);
	map<pair<ll,ll>,ll> ma1,ma2;
	rep(i,0,v1.sz){
		rep(j,0,v1[i].sz){
			ma1[mp(i,v1[i][j].fi)]=v1[i][j].se.fi;
			ma2[mp(i,v1[i][j].fi)]=v1[i][j].se.se;
		}
	}
	rep(i,0,vq.sz){
		ll a = vq[i].fi.fi;
		ll b = vq[i].fi.se;
		ll c = vq[i].se.fi;
		ll d = vq[i].se.se;
		ll e = lca(c,d);
		ll dd = d1[c]+d1[d]-d1[e]*2;
		ll ee1 = ma1[mp(c,a)]+ma1[mp(d,a)]-ma1[mp(e,a)]*2;
		ll ee2 = ma2[mp(c,a)]+ma2[mp(d,a)]-ma2[mp(e,a)]*2;
		cout << dd-ee2+ee1*b << endl;
	}
	return 0;
}

Measured memory_bytes: 91304