#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 10;
const int root = 1;
vector<pair<long long, long long> > segments;
vector<int> w[MAXN];
set<int> store;
vector<int> g[MAXN];
int point[MAXN], dfn[MAXN], fa[MAXN], Map[MAXN], heavy[MAXN], siz[MAXN],
    top[MAXN];
long long prefix_sum[MAXN];
struct HLD {
  int cnt = 0;
  void dfs1(int now, int pre) {
    siz[now] = 1;
    fa[now] = pre;
    for (auto it : g[now]) {
      if (it == pre) continue;
      dfs1(it, now);
      siz[now] += siz[it];
    }
    heavy[now] = 0;
    for (auto it : g[now]) {
      if (it == pre) continue;
      if (siz[heavy[now]] < siz[it]) heavy[now] = it;
    }
  }
  void dfs2(int now, int pre) {
    dfn[now] = ++cnt;
    Map[cnt] = now;
    if (heavy[now]) {
      top[heavy[now]] = top[now];
      dfs2(heavy[now], now);
    }
    for (auto it : g[now]) {
      if (it == pre || it == heavy[now]) continue;
      top[it] = it;
      dfs2(it, now);
    }
  }
  void go() {
    dfs1(root, 0);
    top[root] = root;
    dfs2(root, 0);
  }
} hld;
const int N = 1 << 17;
struct SEGMENT_TREE {
  int tag[N + N] = {0};
  void push_down(int index) {
    if (tag[index]) {
      tag[index << 1] = tag[index << 1 | 1] = tag[index];
      tag[index] = 0;
    }
  }
  void all_set(int a, int b, int val, int now = 1, int l = 1, int r = N + 1) {
    if (a >= r || b <= l) {
      return;
    }
    if (r <= b && l >= a) {
      tag[now] = val;
      return;
    }
    push_down(now);
    int mid = (l + r) >> 1;
    all_set(a, b, val, now << 1, l, mid);
    all_set(a, b, val, now << 1 | 1, mid, r);
  }
  int get_num(int a) {
    a += N - 1;
    int NUM = 0;
    while (a) {
      if (tag[a]) NUM = tag[a];
      a >>= 1;
    }
    return NUM;
  }
} sgt;
void run(int s, int t) {
  int reals = s;
  while (s) {
    int l = dfn[top[s]], r = dfn[s] - 1;
    auto ite = store.lower_bound(l);
    while (ite != store.end() && *ite <= r) {
      long long l = sgt.get_num(*ite) + 1;
      long long r = t;
      if (l != 1) l += prefix_sum[Map[*ite]];
      r += prefix_sum[Map[*ite]];
      segments.push_back(make_pair(l, r));
      point[Map[*ite]] = heavy[Map[*ite]];
      store.erase(ite++);
    }
    int MODIFY = fa[top[s]];
    if (MODIFY) {
      if (point[MODIFY] != top[s]) {
        long long l = sgt.get_num(dfn[MODIFY]) + 1;
        long long r = t;
        if (l != 1) l += prefix_sum[MODIFY];
        r += prefix_sum[MODIFY];
        segments.push_back(make_pair(l, r));
      }
      point[MODIFY] = top[s];
      store.insert(dfn[MODIFY]);
    }
    if (s != reals)
      sgt.all_set(dfn[top[s]], dfn[s] + 1, t);
    else if (top[s] != s) {
      sgt.all_set(dfn[top[s]], dfn[s], t);
    }
    s = fa[top[s]];
  }
}
int n, m;
void go_for_prefix_sum(int now) {
  for (int i = 0; i < g[now].size(); ++i) {
    prefix_sum[g[now][i]] += prefix_sum[now];
    prefix_sum[g[now][i]] += w[now][i];
    go_for_prefix_sum(g[now][i]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 2; i <= n; ++i) {
    int U, V, W;
    cin >> U >> V >> W;
    g[U].push_back(V);
    w[U].push_back(W);
  }
  go_for_prefix_sum(root);
  hld.go();
  for (int i = 1; i <= n; ++i) {
    if (!g[i].empty()) {
      point[i] = g[i].back();
    }
    if (point[i] != heavy[i]) store.insert(dfn[i]);
  }
  vector<pair<int, int> > queries;
  for (int i = 1; i <= m; ++i) {
    int si, ti;
    cin >> si >> ti;
    queries.push_back(make_pair(ti, si));
  }
  for (auto it : queries) {
    run(it.second, it.first);
  }
  sort(segments.begin(), segments.end());
  long long rest1 = 1000000000000000000ll;
  int rest2 = 0;
  long long nowt = 0;
  multiset<long long> rs;
  for (int i = 0; i < segments.size(); ++i) {
    nowt = max(nowt, segments[i].first);
    rs.insert(segments[i].second);
    long long NEX = 1000000000000000000ll;
    if (i != segments.size() - 1) NEX = segments[i + 1].first;
    while (nowt < NEX && !rs.empty() && nowt <= *rs.begin()) {
      rs.erase(rs.begin());
      nowt++;
    }
    if (!rs.empty() && *rs.begin() < nowt) {
      rest1 = min(rest1, *rs.begin());
      rs.clear();
    }
  }
  if (!rs.empty()) rest1 = min(rest1, *rs.begin());
  if (rest1 == 1000000000000000000ll) rest1 = -1;
  if (rest1 == -1)
    rest2 = segments.size();
  else {
    for (auto it : segments)
      if (it.second < rest1) rest2++;
  }
  cout << rest1 << ' ' << rest2 << endl;
  return 0;
}
