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;
inline int read() {
  int X = 0;
  char ch = 0;
  while (ch < 48 || ch > 57) ch = getchar();
  while (ch >= 48 && ch <= 57) X = X * 10 + (ch ^ 48), ch = getchar();
  return X;
}
struct Node {
  int siz, son, f, tf, dep;
} b[100500];
vector<int> g[100500];
void pfs1(int u) {
  b[u].siz = 1;
  for (int i = 0, v; i < g[u].size(); i++)
    if (!b[v = g[u][i]].siz) {
      b[v].dep = b[b[v].f = u].dep + 1;
      pfs1(v);
      b[u].siz += b[v].siz;
      if (b[b[u].son].siz < b[v].siz) b[u].son = v;
    }
}
void pfs2(int u, int tf) {
  b[u].tf = tf;
  if (!b[u].son) return;
  pfs2(b[u].son, tf);
  for (int i = 0, v; i < g[u].size(); i++)
    if (!b[v = g[u][i]].tf) pfs2(v, v);
}
int lca(int x, int y) {
  while (b[x].tf != b[y].tf) {
    if (b[b[x].tf].dep < b[b[y].tf].dep) swap(x, y);
    x = b[b[x].tf].f;
  }
  return b[x].dep < b[y].dep ? x : y;
}
int dis(int x, int y) { return b[x].dep + b[y].dep - 2 * b[lca(x, y)].dep; }
const double eps = 1e-9;
inline bool eq(double x, double y) { return x < y + eps && y < x + eps; }
double tim;
struct Line {
  double k, b, l, r;
  int p;
  double get(double x) const { return k * x + b; }
  void ext() {
    l -= eps;
    r += eps;
  }
  bool operator<(const Line &B) const {
    double y1 = get(tim), y2 = B.get(tim);
    return eq(y1, y2) ? p < B.p : y1 < y2;
  }
};
vector<Line> l[100500];
void addop(int u, int v, double s, double c) {
  double t = s + 1.00 * dis(u, v) / c, bu = 1.00 * b[u].dep + c * s,
         bv = 1.00 * b[v].dep - c * t;
  while (b[u].tf != b[v].tf) {
    if (b[b[u].tf].dep > b[b[v].tf].dep) {
      int p = b[u].tf;
      double pt = 1.00 * (b[u].dep - b[p].dep + 1) / c;
      l[p].push_back((Line){-c, bu, s, s + pt});
      s += pt;
      u = b[p].f;
    } else {
      int p = b[v].tf;
      double pt = -1.00 * (b[v].dep - b[p].dep + 1) / c;
      l[p].push_back((Line){c, bv, t + pt, t});
      t += pt;
      v = b[p].f;
    }
  }
  int p = b[u].tf;
  if (b[u].dep > b[v].dep)
    l[p].push_back((Line){-c, bu, s, t});
  else
    l[p].push_back((Line){c, bv, s, t});
}
set<Line> s;
Line st[100500];
struct Data {
  int p;
  double x;
  bool op;
} t[100500 << 1];
bool cmp(const Data &A, const Data &B) { return A.x < B.x; }
double inter(const Line &A, const Line &B) {
  double l = max(A.l, B.l), r = min(A.r, B.r);
  if (l > r) return 1e18;
  if (eq(A.k, B.k)) return eq(A.b, B.b) ? l : 1e18;
  double x = (B.b - A.b) / (A.k - B.k);
  return l < x && x < r ? x : 1e18;
}
double ans;
void solve(int u) {
  int n = l[u].size();
  for (int i = 0; i < n; i++) (st[i + 1] = l[u][i]).ext();
  if (n <= 10000) {
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) ans = min(ans, inter(st[i], st[j]));
    return;
  }
  for (int i = 1; i <= n; i++) {
    t[i * 2 - 1] = (Data){i, st[i].l, 1};
    t[i * 2] = (Data){i, st[i].r, 0};
    st[i].p = i;
  }
  n *= 2;
  sort(t + 1, t + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    tim = t[i].x;
    if (tim + eps > ans) break;
    Line pl = st[t[i].p];
    if (t[i].op == 1) {
      set<Line>::iterator it2, it = s.insert(pl).first;
      if (it != s.begin()) {
        --(it2 = it);
        ans = min(ans, inter(*it2, *it));
      }
      ++(it2 = it);
      if (it2 != s.end()) {
        ans = min(ans, inter(*it2, *it));
      }
    } else {
      set<Line>::iterator it = s.find(pl), pre = it, nxt = it;
      if (pre != s.begin() && (++nxt) != s.end())
        ans = min(ans, inter(*(--pre), *nxt));
      s.erase(it);
    }
  }
  s.clear();
}
int n, m;
int main() {
  n = read();
  m = read();
  for (int i = 1, f, t; i < n; i++) {
    f = read();
    t = read();
    g[f].push_back(t);
    g[t].push_back(f);
  }
  b[1].dep = 1;
  pfs1(1);
  pfs2(1, 1);
  for (int i = 1, u, v, t, c; i <= m; i++) {
    t = read();
    c = read();
    u = read();
    v = read();
    addop(u, v, t, c);
  }
  ans = 1e18;
  for (int u = 1; u <= n; u++)
    if (b[u].tf == u) solve(u);
  if (ans > 1e17)
    puts("-1");
  else
    printf("%.8lf", ans);
  return 0;
}