#include <bits/stdc++.h>
const int INF = std::numeric_limits<int>::max() / 2;
const long long INFLL = std::numeric_limits<long long>::max() / 2;
const int MAX_N = 1e5 + 5;
namespace lct {
struct Node {
  int L, R, P;
  int PP;
};
Node LCT[MAX_N];
inline void make_tree(int v) {
  if (v == -1) return;
  LCT[v].L = LCT[v].R = LCT[v].P = LCT[v].PP = -1;
}
inline void rotate(int v) {
  if (v == -1) return;
  if (LCT[v].P == -1) return;
  int p = LCT[v].P;
  int g = LCT[p].P;
  if (LCT[p].L == v) {
    LCT[p].L = LCT[v].R;
    if (LCT[v].R != -1) {
      LCT[LCT[v].R].P = p;
    }
    LCT[v].R = p;
    LCT[p].P = v;
  } else {
    LCT[p].R = LCT[v].L;
    if (LCT[v].L != -1) {
      LCT[LCT[v].L].P = p;
    }
    LCT[v].L = p;
    LCT[p].P = v;
  }
  LCT[v].P = g;
  if (g != -1) {
    if (LCT[g].L == p) {
      LCT[g].L = v;
    } else {
      LCT[g].R = v;
    }
  }
  LCT[v].PP = LCT[p].PP;
  LCT[p].PP = -1;
}
inline void splay(int v) {
  if (v == -1) return;
  while (LCT[v].P != -1) {
    int p = LCT[v].P;
    int g = LCT[p].P;
    if (g == -1) {
      rotate(v);
    } else if ((LCT[p].L == v) == (LCT[g].L == p)) {
      rotate(p);
      rotate(v);
    } else {
      rotate(v);
      rotate(v);
    }
  }
}
inline void expose(int v) {
  if (v == -1) return;
  splay(v);
  if (LCT[v].R != -1) {
    LCT[LCT[v].R].PP = v;
    LCT[LCT[v].R].P = -1;
    LCT[v].R = -1;
  }
  while (LCT[v].PP != -1) {
    int w = LCT[v].PP;
    splay(w);
    if (LCT[w].R != -1) {
      LCT[LCT[w].R].PP = w;
      LCT[LCT[w].R].P = -1;
    }
    LCT[w].R = v;
    LCT[v].P = w;
    LCT[v].PP = -1;
    splay(v);
  }
}
inline int find_root(int v) {
  if (v == -1) return -1;
  expose(v);
  int ret = v;
  while (LCT[ret].L != -1) ret = LCT[ret].L;
  expose(ret);
  return ret;
}
inline void link(int v, int w) {
  if (v == -1 || w == -1) return;
  expose(v);
  expose(w);
  LCT[v].L = w;
  LCT[w].P = v;
  LCT[w].PP = -1;
}
inline void cut(int v) {
  if (v == -1) return;
  expose(v);
  if (LCT[v].L != -1) {
    LCT[LCT[v].L].P = -1;
    LCT[v].L = -1;
  }
}
}  // namespace lct
int n, m;
std::vector<std::pair<int, int>> adj[MAX_N];
int dfs_cnt = -1, pre_order[MAX_N], post_order[MAX_N];
long long segment[MAX_N * 4];
int parent[MAX_N];
long long depth[MAX_N];
int switch_dest[MAX_N];
void dfs(int u) {
  pre_order[u] = ++dfs_cnt;
  for (auto [v, d] : adj[u]) {
    depth[v] = depth[u] + d;
    dfs(v);
  }
  post_order[u] = dfs_cnt;
}
void update(unsigned p, unsigned l, unsigned r, unsigned i, long long v) {
  segment[p] = v;
  if (l + 1 != r)
    if (i < l + r >> 1)
      update(p * 2 + 1, l, l + r >> 1, i, v);
    else
      update(p * 2 + 2, l + r >> 1, r, i, v);
}
long long query(unsigned p, unsigned l, unsigned r, unsigned i, unsigned j) {
  if (i <= l && r <= j)
    return segment[p];
  else if (i >= r || l >= j)
    return 0;
  else
    return std::max(query(p * 2 + 1, l, l + r >> 1, i, j),
                    query(p * 2 + 2, l + r >> 1, r, i, j));
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  std::cin >> n >> m;
  for (int i = 1; i < n; ++i) {
    int u, v, d;
    std::cin >> u >> v >> d;
    adj[u].emplace_back(v, d);
    parent[v] = u;
  }
  dfs(1);
  for (int i = 1; i <= n; ++i) lct::make_tree(i);
  for (int i = 1; i <= n; ++i)
    if (!adj[i].empty()) {
      lct::link(adj[i].back().first, i);
      switch_dest[i] = adj[i].back().first;
    }
  std::vector<std::pair<long long, long long>> vector(
      1, std::make_pair(INFLL, INFLL));
  for (int i = 0; i < m; ++i) {
    int dest;
    long long time;
    std::cin >> dest >> time;
    int cur = lct::find_root(dest);
    while (cur != 1) {
      lct::cut(switch_dest[parent[cur]]);
      lct::link(cur, parent[cur]);
      switch_dest[parent[cur]] = cur;
      cur = parent[cur];
      long long prev_time =
          query(0, 0, n, pre_order[cur] + 1, post_order[cur] + 1);
      if (prev_time)
        vector.emplace_back(prev_time + depth[cur] + 1, time + depth[cur]);
      else
        vector.emplace_back(1, time + depth[cur]);
      cur = lct::find_root(cur);
    }
    update(0, 0, n, pre_order[dest], time);
  }
  std::sort(vector.begin(), vector.end(),
            std::greater<std::pair<long long, long long>>());
  std::priority_queue<long long, std::vector<long long>,
                      std::greater<long long>>
      heap;
  std::vector<long long> ans;
  for (long long t = vector.back().first; t != INFLL;
       t = heap.empty() ? vector.back().first : t + 1) {
    while (vector.back().first <= t) {
      heap.push(vector.back().second);
      vector.pop_back();
    }
    if (heap.top() >= t) {
      ans.push_back(heap.top());
      heap.pop();
    } else {
      std::sort(ans.begin(), ans.end());
      while (!ans.empty() && ans.back() >= heap.top()) ans.pop_back();
      std::cout << heap.top() << ' ' << ans.size() << '\n';
      return 0;
    }
  }
  std::cout << "-1 " << ans.size() << '\n';
  return 0;
}
