#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, x, y, d, ds;
int fa[N], df[N], las[N], dy2[N];
long long dep[N], can;
vector<pair<int, int> > e[N];
vector<pair<long long, long long> > ck;
vector<long long> pos;
vector<int> nd[N * 40];
priority_queue<int, vector<int>, greater<int> > A;
unordered_map<int, int> dy;
set<int> hv[N], dd[N];
void dfs(int x) {
  df[++ds] = x;
  bool fir = 0;
  for (pair<int, int> i : e[x])
    if (i.first != fa[x]) {
      if (!fir) {
        fir = 1;
        las[x] = i.first;
      }
      fa[i.first] = x;
      dep[i.first] = dep[x] + i.second;
      dfs(i.first);
    }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 2, _e = n; i <= _e; ++i)
    cin >> x >> y >> d, e[x].push_back(pair<int, int>(y, d)),
        e[y].push_back(pair<int, int>(x, d));
  for (int i = 1, _e = n; i <= _e; ++i) reverse(e[i].begin(), e[i].end());
  dfs(1);
  for (int i = 1, _e = m; i <= _e; ++i) cin >> x >> y, hv[x].insert(y);
  for (int i = n, _e = 1; i >= _e; --i) {
    x = df[i];
    ds = 0;
    for (pair<int, int> i : e[x])
      if (i.first != fa[x] && hv[i.first].size())
        dy2[i.first] = ++ds, swap(dd[ds], hv[i.first]);
    if (ds) {
      int mxp = 0;
      for (int i = 1, _e = ds; i <= _e; ++i)
        if (dd[i].size() > dd[mxp].size()) mxp = i;
      vector<long long> all;
      dy.clear();
      dy[-1] = dy2[las[x]];
      all.push_back(-1);
      int mn = *dd[mxp].begin(), mx = *--dd[mxp].end();
      dy[mn] = mxp;
      all.push_back(mn);
      for (int i = 1, _e = ds; i <= _e; ++i)
        if (i != mxp) {
          for (int j : dd[i]) {
            dy[j] = i;
            all.push_back(j);
            auto l = dd[mxp].lower_bound(j);
            if (j < mx) {
              dy[*l] = mxp;
              all.push_back(*l);
            }
            if (j > mn) {
              --l;
              dy[*l] = mxp;
              all.push_back(*l);
            }
          }
        }
      if (all.size()) {
        sort(all.begin(), all.end());
        all.erase(unique(all.begin(), all.end()), all.end());
        int la = 0;
        for (int i : all) {
          if (la && dy[la] != dy[i])
            ck.push_back(pair<long long, long long>(la == -1 ? 0 : dep[x] + la,
                                                    dep[x] + i));
          la = i;
        }
      }
      if (hv[x].size() < dd[mxp].size()) swap(hv[x], dd[mxp]);
      for (int i = 1, _e = ds; i <= _e; ++i)
        hv[x].insert(dd[i].begin(), dd[i].end());
      for (int i = 1, _e = ds; i <= _e; ++i) dd[i].clear();
    }
  }
  for (auto i : ck) pos.push_back(i.first), pos.push_back(i.second);
  sort(pos.begin(), pos.end());
  pos.erase(unique(pos.begin(), pos.end()), pos.end());
  can = -1;
  for (auto i : ck) {
    x = (lower_bound(pos.begin(), pos.end(), i.first) - pos.begin());
    y = (lower_bound(pos.begin(), pos.end(), i.second) - pos.begin());
    nd[x].push_back(y);
  }
  for (int i = 0, _e = int(pos.size()) - 1; i <= _e; ++i) {
    if (!A.empty() && A.top() == i) {
      can = pos[i];
      break;
    }
    for (int j : nd[i]) A.push(j);
    if (i == int(pos.size()) - 1) break;
    for (int j = 1, _e = pos[i + 1] - pos[i]; j <= _e; ++j) {
      if (A.empty()) break;
      A.pop();
    }
  }
  if (can == -1)
    printf("-1 %d\n", ck.size());
  else {
    int cnt = 0;
    for (auto i : ck) cnt += i.second < can;
    printf("%lld %d\n", can, cnt);
  }
}
