Problem: Tony Stark is playing a game with his suits (they have auto-pilot now). He lives in Malibu. Malibu has n junctions numbered from 1 to n, connected with n - 1 roads. One can get from a junction to any other junction using these roads (graph of Malibu forms a tree).

Tony has m suits. There's a special plan for each suit. The i-th suit will appear at the moment of time ti in the junction vi, and will move to junction ui using the shortest path between vi and ui with the speed ci roads per second (passing a junctions takes no time), and vanishing immediately when arriving at ui (if it reaches ui in time q, it's available there at moment q, but not in further moments). Also, suits move continuously (for example if vi ≠ ui, at time <image> it's in the middle of a road. Please note that if vi = ui it means the suit will be at junction number vi only at moment ti and then it vanishes. 

An explosion happens if at any moment of time two suits share the same exact location (it may be in a junction or somewhere on a road; while appearing, vanishing or moving).

Your task is to tell Tony the moment of the the first explosion (if there will be any).

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 100 000) — the number of junctions and the number of suits respectively.

The next n - 1 lines contain the roads descriptions. Each line contains two integers ai and bi — endpoints of the i-th road (1 ≤ ai, bi ≤ n, ai ≠ bi).

The next m lines contain the suit descriptions. The i-th of them contains four integers ti, ci, vi and ui (0 ≤ ti ≤ 10 000, 1 ≤ ci ≤ 10 000, 1 ≤ vi, ui ≤ n), meaning the i-th suit will appear at moment of time ti at the junction vi and will move to the junction ui with a speed ci roads per second.

Output

If there would be no explosions at all, print -1 in the first and only line of output.

Otherwise print the moment of the first explosion.

Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

6 4
2 5
6 5
3 6
4 6
4 1
27 6 1 3
9 5 1 6
27 4 3 4
11 29 2 6


Output

27.3


Input

6 4
3 1
4 5
6 4
6 1
2 6
16 4 4 5
13 20 6 2
3 16 4 5
28 5 3 5


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const double EPS = 1e-9;
vector<int> v[N];
int sz[N], fa[N], dep[N], hson[N], top[N];
void dfs1(int pos, int f) {
  sz[pos] = 1;
  fa[pos] = f;
  dep[pos] = dep[f] + 1;
  for (auto &i : v[pos])
    if (i != f) {
      dfs1(i, pos), sz[pos] += sz[i];
      if (sz[i] > sz[hson[pos]]) hson[pos] = i;
    }
}
void dfs2(int pos, int tp) {
  top[pos] = tp;
  if (hson[pos]) dfs2(hson[pos], tp);
  for (auto &i : v[pos])
    if (i != fa[pos] && i != hson[pos]) dfs2(i, i);
}
int lca(int x, int y) {
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    x = fa[top[x]];
  }
  return dep[x] < dep[y] ? x : y;
}
inline double calc(int x, int y, double c) { return (dep[x] - dep[y]) / c; }
struct Line {
  int x, id, p;
  double t, c;
} b[N];
double ans = DBL_MAX, t, c[N], ed[N];
inline double calc(const Line &x) { return dep[x.x] + (t - x.t) * c[x.id]; }
inline bool operator<(const Line &x, const Line &y) {
  return calc(x) < calc(y);
}
void update(const Line &x, const Line &y) {
  double v = calc(y) - calc(x),
         p = abs(v) < EPS ? 0 : (calc(y) - calc(x)) / (c[x.id] - c[y.id]);
  if (p > -EPS && p + t < min(ed[x.id], ed[y.id]) + EPS) ans = min(ans, p + t);
}
multiset<Line> s;
vector<Line> f[N];
void solve(int pos) {
  s.clear();
  sort(f[pos].begin(), f[pos].end(), [](const Line &a, const Line &b) {
    return abs(a.t - b.t) < EPS ? a.p > b.p : a.t < b.t;
  });
  for (auto &i : f[pos])
    if (i.p)
      b[i.id] = i;
    else
      ed[i.id] = i.t;
  for (auto &i : f[pos]) {
    if ((t = i.t) > ans + EPS) break;
    if (i.p) {
      auto it = s.insert(i);
      c[i.id] = i.c;
      if (it != s.begin()) update(i, *prev(it));
      if (++it != s.end()) update(i, *it);
    } else {
      auto it = s.find(b[i.id]);
      if (it != s.begin() && next(it) != s.end()) update(*prev(it), *next(it));
      if (it != s.end()) s.erase(it);
    }
  }
}
int n, m;
bool vis[N];
inline int read() {
  int x;
  cin >> x;
  return x;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  int t1, t2;
  for (int i = 1; i < n; i++)
    cin >> t1 >> t2, v[t1].push_back(t2), v[t2].push_back(t1);
  dfs1(1, 0);
  dfs2(1, 1);
  for (int i = 1; i <= m; i++) {
    double t = read(), tt;
    c[i] = read();
    int x, y;
    cin >> x >> y;
    int u = x, v = y, p = lca(u, v), fl = 1;
    tt = t + calc(u, p, c[i]);
    while (top[u] != top[v]) {
      if (dep[top[u]] < dep[top[v]]) swap(u, v), fl ^= 1;
      if (fl)
        f[top[u]].push_back({u, i, 1, t + calc(x, u, c[i]), -c[i]}),
            f[top[u]].push_back(
                {fa[top[u]], i, 0, t + calc(x, fa[top[u]], c[i]), -c[i]});
      else
        f[top[u]].push_back({u, i, 0, tt + calc(u, p, c[i]), c[i]}),
            f[top[u]].push_back(
                {fa[top[u]], i, 1, tt + calc(fa[top[u]], p, c[i]), c[i]});
      u = fa[top[u]];
    }
    if (dep[u] < dep[v]) swap(u, v), fl ^= 1;
    if (fl)
      f[top[u]].push_back({u, i, 1, t + calc(x, u, c[i]), -c[i]}),
          f[top[u]].push_back({v, i, 0, tt, -c[i]});
    else
      f[top[u]].push_back({v, i, 1, tt, c[i]}),
          f[top[u]].push_back({u, i, 0, tt + calc(u, v, c[i]), c[i]});
  }
  for (int i = 1; i <= n; i++)
    if (!vis[top[i]]) vis[top[i]] = 1, solve(top[i]);
  if (ans == DBL_MAX)
    cout << -1 << endl;
  else
    printf("%.8lf\n", ans);
  return 0;
}