#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
typedef vector<vector<int>> Graph;
template< typename G >
struct DoublingLowestCommonAncestor {
  const int LOG;
  vector< int > dep;
  const G &g;
  vector< vector< int > > table;

  DoublingLowestCommonAncestor(const G &g) : g(g), dep(g.size()), LOG(32 - __builtin_clz(g.size())) {
    table.assign(LOG, vector< int >(g.size(), -1));
  }

  void dfs(int idx, int par, int d) {
    table[0][idx] = par;
    dep[idx] = d;
    for(auto &to : g[idx]) {
      if(to != par) dfs(to, idx, d + 1);
    }
  }

  void build() {
    dfs(0, -1, 0);
    for(int k = 0; k + 1 < LOG; k++) {
      for(int i = 0; i < table[k].size(); i++) {
        if(table[k][i] == -1) table[k + 1][i] = -1;
        else table[k + 1][i] = table[k][table[k][i]];
      }
    }
  }

  int query(int u, int v) {
    if(dep[u] > dep[v]) swap(u, v);
    for(int i = LOG - 1; i >= 0; i--) {
      if(((dep[v] - dep[u]) >> i) & 1) v = table[i][v];
    }
    if(u == v) return u;
    for(int i = LOG - 1; i >= 0; i--) {
      if(table[i][u] != table[i][v]) {
        u = table[i][u];
        v = table[i][v];
      }
    }
    return table[0][u];
  }
};

typedef pair<ll, l_l> lll;
vector<lll> pathes[100050];
ll ans[100050];
ll dist[100050];
ll num[100050];
vector<lll> Plus[100050], Minus[100050];
ll nowdist = 0;

void dfs(int now, int from) {
    /*
    cerr << "---" << now << "---" << endl;
    cerr << nowdist << endl;
    for(int i = 1; i <= 4; i++) {
        cerr << num[i] << " " << dist[i] << endl;
    }
    */
    for(auto q : Plus[now]) {
        ll val = nowdist;
        val -= dist[q.second.first];
        val += num[q.second.first] * q.second.second;
        ans[q.first] += val;
    }
    for(auto q : Minus[now]) {
        ll val = nowdist;
        val -= dist[q.second.first];
        val += num[q.second.first] * q.second.second;
        ans[q.first] -= val;
    }
    for(auto to : pathes[now]) {
        if(to.first == from) continue;
        num[to.second.first]++;
        dist[to.second.first] += to.second.second;
        nowdist += to.second.second;
        dfs(to.first, now);
        num[to.second.first]--;
        dist[to.second.first] -= to.second.second;
        nowdist -= to.second.second;
    }
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, Q;
    cin >> N >> Q;
    Graph g(N);
    for(int i = 1; i <= N - 1; i++) {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        a--;
        b--;
        pathes[a].push_back({b, {c, d}});
        pathes[b].push_back({a, {c, d}});
        g[a].push_back(b);
        g[b].push_back(a);
    }
    DoublingLowestCommonAncestor<Graph> LCA(g);
    LCA.build();
    for(int q = 1; q <= Q; q++) {
        ll x, y, u, v;
        cin >> x >> y >> u >> v;
        u--;
        v--;
        ll lca = LCA.query(u, v);
        Plus[u].push_back({q, {x, y}});
        Plus[v].push_back({q, {x, y}});
        Minus[lca].push_back({q, {x, y}});
        Minus[lca].push_back({q, {x, y}});
    }
    dfs(0, -1);
    for(int q = 1; q <= Q; q++) cout << ans[q] << endl;
    return 0;
}


Measured memory_bytes: 45936