#include <bits/stdc++.h>
using namespace std;
inline void open(const char *s) {}
inline int rd() {
  static int x, f;
  x = 0;
  f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return f > 0 ? x : -x;
}
const int N = 100010;
int n, m;
struct edge {
  int v, w, next;
} e[N << 1];
int tot = 0, head[N];
inline void add(int u, int v, int z) {
  e[++tot] = edge{v, z, head[u]};
  head[u] = tot;
}
vector<pair<long long, long long> > vec;
priority_queue<long long, vector<long long>, greater<long long> > q;
namespace LCT {
struct tree {
  int ch[2], fa;
  long long d, t, tag;
} tr[N];
inline bool isrt(int o) {
  return tr[tr[o].fa].ch[0] != o && tr[tr[o].fa].ch[1] != o;
}
inline void upd(int o, long long d) {
  if (!o) return;
  tr[o].t = tr[o].tag = d;
}
inline void pushdown(int o) {
  int ls = tr[o].ch[0], rs = tr[o].ch[1];
  if (tr[o].tag) {
    upd(ls, tr[o].tag);
    upd(rs, tr[o].tag);
    tr[o].tag = 0;
  }
}
inline void rotate(int x) {
  int y = tr[x].fa, z = tr[y].fa, t1 = tr[y].ch[1] == x, t2 = t1 ^ 1;
  if (!isrt(y)) tr[z].ch[tr[z].ch[1] == y] = x;
  tr[x].fa = z;
  tr[y].fa = x;
  if (tr[x].ch[t2]) tr[tr[x].ch[t2]].fa = y;
  tr[y].ch[t1] = tr[x].ch[t2];
  tr[x].ch[t2] = y;
}
inline void splay(int x) {
  static int st[N], top;
  int hh = x;
  st[top = 1] = x;
  for (; !isrt(x); st[++top] = x = tr[x].fa)
    ;
  while (top) pushdown(st[top--]);
  x = hh;
  for (; !isrt(x); rotate(x)) {
    int y = tr[x].fa, z = tr[y].fa;
    if (isrt(y)) continue;
    if ((tr[y].ch[0] == x) ^ (tr[z].ch[0] == y))
      rotate(x);
    else
      rotate(y);
  }
}
inline void access(int rt, int t) {
  splay(rt);
  for (int x = tr[rt].fa, s = rt; x; s = x, x = tr[x].fa) {
    splay(x);
    vec.emplace_back(tr[x].t + tr[x].d + 1, t + tr[x].d);
    tr[x].ch[1] = s;
  }
  splay(rt);
  upd(tr[rt].ch[0], t);
}
}  // namespace LCT
void dfs(int u, int fat) {
  using LCT::tr;
  tr[u].fa = fat;
  tr[u].t = -tr[u].d;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].v;
    if (v == fat) continue;
    tr[v].d = tr[u].d + e[i].w;
    dfs(v, u);
  }
}
inline void solve() {
  sort(vec.begin(), vec.end());
  long long hh = 1;
  int cnt = 0;
  for (int i = 0; i <= (int)vec.size() - 1; i++) {
    pair<long long, long long> x = vec[i];
    for (; hh < x.first && q.size(); q.pop()) {
      long long y = q.top();
      if (hh > y) {
        for (int j = 0; j <= i - 1; j++) cnt -= vec[j].second >= y;
        for (; q.size(); q.pop()) cnt += q.top() >= y;
        cout << y << ' ' << cnt << '\n';
        exit(0);
      }
      ++hh;
      ++cnt;
    }
    hh = max(hh, x.first);
    q.push(x.second);
  }
  for (; q.size(); q.pop()) {
    long long y = q.top();
    if (hh > y) {
      for (int j = 0; j <= (int)vec.size() - 1; j++) cnt -= vec[j].second >= y;
      for (; q.size(); q.pop()) cnt += q.top() >= y;
      cout << y << ' ' << cnt << '\n';
      exit(0);
    }
    ++hh;
    ++cnt;
  }
  cout << -1 << ' ' << cnt << '\n';
}
int main() {
  open("hh");
  n = rd();
  m = rd();
  for (int i = 2; i <= n; i++) {
    int x = rd(), y = rd(), z = rd();
    add(x, y, z);
    add(y, x, z);
    LCT::tr[x].ch[1] = y;
  }
  dfs(1, 0);
  for (int i = 1; i <= m; i++) {
    int s = rd(), t = rd();
    LCT::access(s, t);
  }
  solve();
  return 0;
}
