#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cassert>
#include<ctime>
using namespace std;

#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define absd(x) (x<0?-(x):x)
#define pow2(x) ((x)*(x))
#define rep(i,n) for(int i=0; i<n; ++i)
#define repr(i,n) for(int i=n-1; i>=0; --i)
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define replr(i,s,n) for(int i=n; i>=s; --i)
#define repf(i,s,n,j) for(int i=s; i<=n; i+=j)
#define repe(e,obj) for(auto e : obj)

#define SP << " " <<
#define COL << " : " <<
#define COM << ", " <<
#define ARR << " -> " <<
#define PNT(STR) cout << STR << endl
#define POS(X,Y) "(" << X << ", " << Y << ")"
#define DEB(A) " (" << #A << ") " << A
#define DEBREP(i,n,val) for(int i=0; i<n; ++i) cout << val << " "; cout << endl
#define ALL(V) (V).begin(), (V).end()
#define INF 1000000007
#define INFLL 1000000000000000007LL
#define EPS 1e-9

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define P_TYPE int
typedef pair<P_TYPE, P_TYPE> P;
typedef pair<P, P_TYPE> PI;
typedef pair<P_TYPE, P> IP;
typedef pair<P, P> PP;
typedef priority_queue<P, vector<P>, greater<P> > pvqueue;

#define N 100003
#define LEV 21

class LCADoubling {
  int n, lev;
  int kprv[LEV][N], de[N];
public:
  LCADoubling(int n) : n(n) {
    int n0 = 1;
    lev = 0;
    while(n0 < n) n0 <<= 1, ++lev;
  }
  void construct(int *prv, int *depth) {
    for(int i=0; i<n; ++i) kprv[0][i] = prv[i], de[i] = depth[i];
    for(int k=0; k<lev; ++k) {
      for(int i=0; i<n; ++i) {
        if(kprv[k][i] == -1) continue;
        kprv[k+1][i] = kprv[k][kprv[k][i]];
      }
    }
  }

  int query(int u, int v) {
    int dd = de[v] - de[u];
    if(dd < 0) {
      swap(u, v);
      dd = -dd;
    }

    // de[u] <= de[v]
    for(int k=0; k<=lev; ++k) {
      if(dd & 1) {
        v = kprv[k][v];
      }
      dd >>= 1;
    }

    // de[u] == de[v]
    if(u == v) return u;

    for(int k=lev-1; k>=0; --k) {
      int pu = kprv[k][u], pv = kprv[k][v];
      if(pu != pv) u = pu, v = pv;
    }
    return kprv[0][u];
  }
};

struct Edge {
  int w, c, d;
};

int n, q;
int prv[N], depth[N];
bool used[N];
vector<Edge> g[N];
vector<int> d0[N], d1[N];
int x[N], y[N];
int qd[N], ed[N], cd[N];
void dfs(int v, ll dc) {
  repe(i, d0[v]) {
    int xi = x[i], yi = y[i];
    qd[i] += dc - ed[xi] + cd[xi]*yi;
  }
  repe(i, d1[v]) {
    int xi = x[i], yi = y[i];
    qd[i] -= 2*(dc - ed[xi] + cd[xi]*yi);
  }
  repe(&e, g[v]) {
    if(e.w == prv[v]) continue;
    cd[e.c] += 1; ed[e.c] += e.d;
    dfs(e.w, dc + e.d);
    cd[e.c] -= 1; ed[e.c] -= e.d;
  }
}

int main() {
  cin >> n >> q;
  rep(i, n-1) {
    int a, b, c, d;
    cin >> a >> b >> c >> d; --a; --b;
    g[a].emplace_back(Edge{b, c, d});
    g[b].emplace_back(Edge{a, c, d});
  }

  queue<int> que;
  que.push(0);
  prv[0] = -1;
  depth[0] = 0;
  used[0] = true;
  while(!que.empty()) {
    int v = que.front(); que.pop();
    repe(&e, g[v]) {
      if(used[e.w]) continue;
      used[e.w] = true;
      prv[e.w] = v;
      depth[e.w] = depth[v] + 1;
      que.push(e.w);
    }
  }

  LCADoubling lca(n);
  lca.construct(prv, depth);

  rep(i, q) {
    int u, v;
    cin >> x[i] >> y[i] >> u >> v; --u; --v;
    int w = lca.query(u, v);
    d0[u].push_back(i);
    d0[v].push_back(i);
    d1[w].push_back(i);
  }
  dfs(0, 0);
  rep(i, q) {
    cout << qd[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 29240