#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;

class FastIO {
  static const int rdata_sz = (1 << 25), wdata_sz = (1 << 25);
  char rdata[rdata_sz], wdata[wdata_sz], *rb, *wb;
  char tmp_s[20];

public:
  FastIO() {
    fread(rdata, 1, rdata_sz, stdin);
    rb = rdata; wb = wdata;
  }
  ~FastIO() {
    fwrite(wdata, 1, wb - wdata, stdout);
  }

  template<typename T>
  inline void read_i(T &x) {
    bool neg = false;
    x = 0;
    while((*rb < '0' || *rb > '9') && *rb != '-') ++rb;
    if(*rb == '-') {
      neg = true;
      ++rb;
    }
    while('0' <= *rb && *rb <= '9') {
      x = 10 * x + (*rb - '0');
      ++rb;
    }
    if(neg) x = -x;
  }

#define pc(x) *(wb++) = x
  template<typename T>
  inline void writeln_i(T x) {
    if (x == 0) { pc('0'); pc('\n'); return; }
    if(x < 0) { pc('-'); x = -x; }
    char *t = tmp_s;
    while(x) {
      T y = x / 10;
      *(t++) = (x - y*10) + '0';
      x = y;
    }
    while(t != tmp_s) pc(*(--t));
    pc('\n');
  }
#undef pc
};
FastIO io;

#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() {
  io.read_i(n); io.read_i(q);
  rep(i, n-1) {
    int a, b, c, d;
    io.read_i(a);
    io.read_i(b);
    io.read_i(c);
    io.read_i(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;
    io.read_i(x[i]);
    io.read_i(y[i]);
    io.read_i(u);
    io.read_i(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) {
    io.writeln_i(qd[i]);
  }
  return 0;
}

Measured memory_bytes: 38356