#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 10, maxl = 20, maxg = maxn * maxl;
const long long int INF = 1e18;
int siz[maxn], pos[maxn], grp[maxn];
long long int h[maxn], wei[maxg], tim[maxn], vert[maxg];
set<int> *s[maxn];
vector<pair<long long int, long long int> > reqs;
vector<pair<int, int> > adj[maxn];
vector<int> vec[maxn];
int n, m, grpcnt;
void dfs(int u, int p = -1) {
  siz[u] = 1;
  for (auto e : adj[u])
    if (e.first != p) {
      h[e.first] = h[u] + e.second;
      dfs(e.first, u);
      siz[u] += siz[e.first];
      pos[u] = e.first;
    }
}
void get_reqs(int u) {
  for (auto e : adj[u]) get_reqs(e.first);
  if (((int)(adj[u]).size()) == 0)
    s[u] = new set<int>;
  else {
    s[u] = s[adj[u][0].first];
    int basegrp = grpcnt;
    vector<int> checks;
    for (int i = 0; i < ((int)(adj[u]).size()); i++) {
      int v = adj[u][i].first, w = adj[u][i].second;
      vert[grpcnt] = v;
      wei[grpcnt] = w;
      if (i == 0) {
        grpcnt++;
        continue;
      }
      for (int t : *s[v]) {
        grp[t] = grpcnt;
        s[u]->insert(t);
        checks.push_back(t);
      }
      s[v]->clear();
      grpcnt++;
    }
    for (auto t : checks) {
      int gt = max(basegrp, grp[t]);
      auto it = s[u]->upper_bound(t);
      if (it != s[u]->end()) {
        int tt = *it;
        int gtt = max(basegrp, grp[tt]);
        if (gtt < gt)
          reqs.push_back(make_pair(h[u] + tim[t] + 1, h[u] + tim[tt]));
      }
      if (it == s[u]->begin()) continue;
      it--;
      if (it == s[u]->begin()) continue;
      it--;
      int tt = *it;
      int gtt = max(basegrp, grp[tt]);
      if (gtt < gt)
        reqs.push_back(make_pair(h[u] + tim[tt] + 1, h[u] + tim[t]));
    }
    if (((int)(*s[u]).size())) {
      int t = *s[u]->begin();
      int gt = max(basegrp, grp[t]);
      if (vert[gt] != pos[u]) reqs.push_back(make_pair(1, h[u] + tim[t]));
    }
  }
  for (auto t : vec[u]) s[u]->insert(t);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int fi, se, th;
    cin >> fi >> se >> th;
    fi--, se--;
    adj[fi].push_back(make_pair(se, th));
    adj[se].push_back(make_pair(fi, th));
  }
  dfs(0);
  for (int i = 0; i < n; i++) {
    sort((adj[i]).begin(), (adj[i]).end(),
         [](pair<int, int> i, pair<int, int> j) -> bool {
           return siz[i.first] < siz[j.first];
         });
    if (i) adj[i].pop_back();
    reverse((adj[i]).begin(), (adj[i]).end());
  }
  for (int i = 0; i < m; i++) {
    int fi, se;
    cin >> fi >> se;
    fi--;
    tim[i] = se;
    vec[fi].push_back(i);
  }
  get_reqs(0);
  sort((reqs).begin(), (reqs).end());
  multiset<long long int> deadlines;
  long long int curt = 0;
  long long int ans = INF;
  for (int i = 0; i < ((int)(reqs).size()); i++) {
    if (curt < reqs[i].first) curt = reqs[i].first;
    deadlines.insert(reqs[i].second);
    while (((int)(deadlines).size()) and
           (i + 1 == ((int)(reqs).size()) or curt < reqs[i + 1].first)) {
      if (curt > *deadlines.begin()) (ans) = min((ans), (*deadlines.begin()));
      deadlines.erase(deadlines.begin());
      curt++;
    }
  }
  if (ans == INF)
    cout << -1 << ' ' << ((int)(reqs).size()) << '\n';
  else {
    cout << ans << ' ';
    int cnt = 0;
    for (auto req : reqs) cnt += req.second < ans;
    cout << cnt << '\n';
  }
  return 0;
}
