// includes
#include <bits/stdc++.h>

// macros
#define ll long long int
#define pb emplace_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(itr, st) for(auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for(auto itr = (st).rbegin(); itr != (st).rend(); ++itr)
#define vrep(v, i) for(int i = 0; i < (v).size(); i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define FI first
#define SE second
#define dump(a, n) for(int i = 0; i < n; i++)cout << a[i] << "\n "[i + 1 != n];
#define dump2(a, n, m) for(int i = 0; i < n; i++)for(int j = 0; j < m; j++)cout << a[i][j] << "\n "[j + 1 != m];
#define bit(n) (1LL<<(n))
#define INT(n) int n; cin >> n;
#define LL(n) ll n; cin >> n;
#define DOUBLE(n) double n; cin >> n;
using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
typedef complex<double> cd;

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

// solve
template <class T>bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} return 0;}
template <class T>bool chmin(T &a, const T &b){if(a > b){a = b; return 1;} return 0;}
template <typename T> istream &operator>>(istream &is, vector<T> &vec){for(auto &v: vec)is >> v; return is;}
template <typename T> ostream &operator<<(ostream &os, const vector<T>& vec){for(int i = 0; i < vec.size(); i++){ os << vec[i]; if(i + 1 != vec.size())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_set<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T> ostream &operator<<(ostream &os, const unordered_multiset<T>& st){for(auto itr = st.begin(); itr != st.end(); ++itr){ os << *itr; auto titr = itr; if(++titr != st.end())os << " ";} return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p){os << p.first << " " << p.second; return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << itr->first << ":" << itr->second; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}
template <typename T1, typename T2> ostream &operator<<(ostream &os, const unordered_map<T1, T2> &mp){for(auto itr = mp.begin(); itr != mp.end(); ++itr){ os << itr->first << ":" << itr->second; auto titr = itr; if(++titr != mp.end())os << " "; } return os;}

struct Tree2{
  int n = 0, m = 0;
  vector<vector<int>> edge;
  vector<vector<int>> par;
  vector<bool> vis;
  vector<int> h;
  Tree2(){}
  Tree2(int n): n(n){
    while((1LL<<m) <= n)m++;
    edge.resize(n);
    par.assign(m + 1, vector<int>(n, 0));
    vis.resize(n, false);
    h.resize(n);
  }
  void adde(int from, int to){
    edge[from].emplace_back(to);
  }
  void dfs(int i){
    vis[i] = true;
    for(auto e: edge[i]){
      if(!vis[e]){
        par[0][e] = i;
        h[e] = h[i] + 1;
        dfs(e);
      }
    }
  }
  void build(){
    fill(vis.begin(), vis.end(), false);
    fill(h.begin(), h.end(), 0);
    par[0][0] = 0;
    h[0] = 0;
    dfs(0);
    for(int i = 1; i <= m; i++){
      for(int j = 0; j < n; j++){
        par[i][j] = par[i-1][par[i-1][j]];
      }
    }
  }
  int go_up(int u, int k){
    int i = 0;
    while(k){
      if(k % 2 == 1){
        u = par[i][u];
      }
      i++;
      k /= 2;
    }
    return u;
  }
  int lca(int u, int v){
    if(h[u] > h[v])u = go_up(u, h[u] - h[v]);
    if(h[u] < h[v])v = go_up(v, h[v] - h[u]);
    if(u == v)return u;
    int ld = 0, rd = n;
    while(rd - ld > 1){
      int k = (rd + ld) / 2;
      int uk = go_up(u, k);
      int vk = go_up(v, k);
      if(uk == vk)rd = k;
      else ld = k;
    }
    return go_up(u, rd);
  }
};

struct Tree{
  int n = 0;
  vector<vector<int>> edges;
  vector<int> b, e;
  vector<int> v;
  Tree(){}
  Tree(int n): n(n){
    edges.resize(n);
    b.resize(n);
    e.resize(n);
    v.reserve(2 * n - 1);
  }
  void adde(int from, int to){
    edges[from].emplace_back(to);
  }
  void dfs(int i){
    v.emplace_back(i);
    b[i] = int(v.size()) - 1;
    for(auto c: edges[i]){
      if(b[c] == -1)dfs(c);
      v.emplace_back(i);
    }
    e[i] = int(v.size()) - 1;
  }
  void build(int r = 0){
    b.assign(n, -1);
    e.assign(n, -1);
    v.resize(0);
    dfs(r);
  }
};

template<typename T>
struct BIT_{
  int n;
  vector<T> bit;
  //vector<ll> aux;
  BIT_(){}
  BIT_(int n_){
    n = n_;
    bit = vector<T>(n+1, 0);
    //aux.assign(n + 1, 1);
  }
  void add(int a, T w){
    if(a < 0)return;
    for(int x = a; x < n; x |= (x + 1)){
      //bit[x] += w * aux[x];
      bit[x] += w;
    }
  }
  T sum(int a){
    if(a < 0)return 0;
    T res = 0;
    for(int x = a; x >= 0; x = (x & (x + 1)) - 1){
      res += bit[x];
    }
    return res;
  }
  int lower_bound(T w){
    int x = 0;
    int m = 1;
    while(m <= n)m *= 2;
    for(int k = m; k > 0; k /= 2){
      if(x + k <= n && bit[x+k-1] < w){
        w -= bit[x+k-1];
        x += k;
      }
    }
    return x;
  }
};

typedef struct BIT_<int> BITI;
typedef struct BIT_<long long> BITL;

struct edge{
  int to, c;
  ll d;
  edge(int to, int c, ll d): to(to), c(c), d(d){}
};

vector<edge> ee[100010], child[100010];
int xx[100010], uu[100010], vv[100010];
ll y[100010];

vector<int> qu[100010];
vector<edge> qux[100010];
bool vis[100010];

void dfs(int i){
  vis[i] = true;
  for(auto ed: ee[i]){
    if(!vis[ed.to]){
      child[i].pb(ed);
      dfs(ed.to);
    }
  }
}

int main(int argc, char const* argv[])
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  INT(n); INT(q);
  rep(i, n - 1){
    INT(a); INT(b); INT(c); LL(d); a--; b--;
    ee[a].pb(edge(b, c, d));
    ee[b].pb(edge(a, c, d));
  }
  dfs(0);
  Tree eul(n);
  Tree2 lca(n);
  rep(i, q){
    cin >> xx[i] >> y[i] >> uu[i] >> vv[i], uu[i]--, vv[i]--;
    qu[xx[i]].pb(i);
  }
  rep(i, n){
    for(auto &ed: child[i]){
      lca.adde(i, ed.to);
      eul.adde(i, ed.to);
      qux[ed.c].pb(edge(i, ed.to, ed.d));
    }
  }
  lca.build();
  eul.build();

  BITL bt(2 * n - 1);
  rep(i, 100001){
    for(auto &ed: child[i]){
      bt.add(eul.b[ed.to], ed.d);
      bt.add(eul.e[ed.to] + 1, - ed.d);
    }
  }
  BITL btw(2 * n - 1), btc(2 * n - 1);
  vector<ll> ans(q, 0);
  rep(i, 100001){
    for(auto &ed: qux[i]){
      btw.add(eul.b[ed.c], ed.d);
      btw.add(eul.e[ed.c] + 1, - ed.d);
      btc.add(eul.b[ed.c], 1);
      btc.add(eul.e[ed.c] + 1, - 1);
    }
    for(int j: qu[i]){
      //cout << j << endl;
      int p = lca.lca(uu[j], vv[j]);
      //cout << p << endl;
      ll res = bt.sum(eul.b[uu[j]]);
      //cout << res << endl;
      res += bt.sum(eul.b[vv[j]]);
      //cout << res << endl;
      res -= 2 * bt.sum(eul.b[p]);
      //cout << res << endl;
      res -= btw.sum(eul.b[uu[j]]);
      //cout << res << endl;
      res -= btw.sum(eul.b[vv[j]]);
      //cout << res << endl;
      res += 2 * btw.sum(eul.b[p]);
      //cout << res << endl;
      ll cnt = btc.sum(eul.b[uu[j]]);
      //cout << cnt << endl;
      cnt += btc.sum(eul.b[vv[j]]);
      cnt -= 2 * btc.sum(eul.b[p]);
      res = res + y[j] * cnt;
      ans[j] = res;
    }
    for(auto &ed: qux[i]){
      btw.add(eul.b[ed.c], - ed.d);
      btw.add(eul.e[ed.c] + 1, ed.d);
      btc.add(eul.b[ed.c], - 1);
      btc.add(eul.e[ed.c] + 1, 1);
    }
  }
  rep(i, q)cout << ans[i] << endl;
  return 0;
}


Measured memory_bytes: 52980