#include <bits/stdc++.h>
using namespace std;
struct ST1 {
  int mx[400010];
  void update(int root) {
    mx[root] = max(mx[root << 1], mx[root << 1 | 1]);
    return;
  }
  void change(int root, int l, int r, int x, int y) {
    if (l == r) {
      mx[root] = y;
      return;
    }
    int mid = (l + r) >> 1;
    if (x <= mid)
      change(root << 1, l, mid, x, y);
    else
      change(root << 1 | 1, mid + 1, r, x, y);
    update(root);
    return;
  }
  int query(int root, int l, int r, int x, int y) {
    if (x > y) return 0;
    if (x <= l && r <= y) return mx[root];
    int mid = (l + r) >> 1, ans = 0;
    if (x <= mid) ans = max(ans, query(root << 1, l, mid, x, y));
    if (y > mid) ans = max(ans, query(root << 1 | 1, mid + 1, r, x, y));
    return ans;
  }
} A;
int dfn[100010], to[100010], now;
struct ST2 {
  int X[800010], Y[800010];
  bool cmp(int a, int b) { return dfn[a] < dfn[b]; }
  void update(int root) {
    int v1 = minval(root << 1);
    int v2 = minval(root << 1 | 1);
    if (cmp(v1, v2))
      X[root] = v1;
    else
      X[root] = v2;
    return;
  }
  int minval(int root) {
    if (Y[root]) return Y[root];
    return X[root];
  }
  void pushdown(int root, int l, int r) {
    if (!Y[root]) return;
    if (l < r) {
      if (X[root] == minval(root << 1)) Y[root << 1] = Y[root];
      if (X[root] == minval(root << 1 | 1)) Y[root << 1 | 1] = Y[root];
    }
    X[root] = Y[root];
    Y[root] = 0;
    return;
  }
  void build(int root, int l, int r, int* a) {
    if (l == r) {
      X[root] = a[l];
      return;
    }
    int mid = (l + r) >> 1;
    build(root << 1, l, mid, a);
    build(root << 1 | 1, mid + 1, r, a);
    update(root);
    return;
  }
  void modify(int root, int l, int r, int x, int y, int fr, int to) {
    pushdown(root, l, r);
    if (x <= l && r <= y) {
      if (fr == X[root]) {
        Y[root] = to;
        pushdown(root, l, r);
      }
      return;
    }
    int mid = (l + r) >> 1;
    if (x <= mid) modify(root << 1, l, mid, x, y, fr, to);
    if (y > mid) modify(root << 1 | 1, mid + 1, r, x, y, fr, to);
    update(root);
    return;
  }
  int query(int root, int l, int r, int x) {
    pushdown(root, l, r);
    if (l == r) return X[root];
    int mid = (l + r) >> 1;
    if (x <= mid)
      return query(root << 1, l, mid, x);
    else
      return query(root << 1 | 1, mid + 1, r, x);
  }
} B;
struct Edge {
  int v, c, nxt;
} e[200010];
int tot;
int first[100010];
void build(int u, int v, int c) {
  e[++tot] = (Edge){v, c, first[u]};
  first[u] = tot;
  return;
}
long long dis[100010];
int fa[100010], top[100010];
int son[100010];
void dfs(int u) {
  dfn[u] = ++now;
  for (int i = first[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == son[u])
      top[v] = top[u];
    else
      top[v] = v;
    dis[v] = dis[u] + e[i].c;
    fa[v] = u;
    dfs(v);
  }
  to[u] = now;
  return;
}
int a[100010];
int n, m;
int s[100010], t[100010];
int Top(int u) { return B.query(1, 1, n, dfn[u]); }
int S(int u, int v) {
  int o = Top(u);
  int x = son[u];
  B.modify(1, 1, n, dfn[x], to[x], o, x);
  B.modify(1, 1, n, dfn[v], to[v], v, o);
  son[u] = v;
  return o;
}
int Pre(int u) { return A.query(1, 1, n, dfn[u] + 1, to[u]); }
long long Tim(int id, int u) {
  if (!id) return 0ll;
  return t[id] + dis[u];
}
struct Seg {
  long long l, r;
  Seg(long long a = 0, long long b = 0) {
    l = a;
    r = b;
  }
} seg[6000010];
bool operator<(const Seg& a, const Seg& b) { return a.r > b.r; }
bool cmp(Seg a, Seg b) { return a.l < b.l; }
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n; i++) {
    int u, v, c;
    scanf("%d %d %d", &u, &v, &c);
    build(u, v, c);
    son[u] = v;
  }
  for (int i = 1; i <= m; i++) scanf("%d %d", &s[i], &t[i]);
  top[1] = 1;
  dfs(1);
  for (int i = 1; i <= n; i++) a[dfn[i]] = top[i];
  B.build(1, 1, n, a);
  int N = 0;
  for (int i = 1; i <= m; i++) {
    int u = Top(s[i]);
    while (fa[u]) {
      int v = fa[u];
      seg[++N] = Seg(Tim(Pre(v), v) + 1, Tim(i, v));
      u = S(v, u);
    }
    A.change(1, 1, n, dfn[s[i]], i);
  }
  priority_queue<Seg> q;
  sort(seg + 1, seg + N + 1, cmp);
  long long T = 0;
  int now = 1;
  while (now <= N || !q.empty())
    if (q.empty()) {
      T = seg[now].l;
      while (now <= N && seg[now].l == T) q.push(seg[now++]);
    } else {
      Seg x = q.top();
      q.pop();
      if (T > x.r) {
        int res = 0;
        for (int i = 1; i <= N; i++)
          if (seg[i].r < x.r) res++;
        printf("%I64d %d\n", x.r, res);
        return 0;
      }
      T++;
      while (now <= N && seg[now].l == T) q.push(seg[now++]);
    }
  printf("-1 %d\n", N);
  return 0;
}
