Problem: This winter is so... well, you've got the idea :-) The Nvodsk road system can be represented as n junctions connected with n - 1 bidirectional roads so that there is a path between any two junctions. The organizers of some event want to choose a place to accommodate the participants (junction v), and the place to set up the contests (junction u). Besides, at the one hand, they want the participants to walk about the city and see the neighbourhood (that's why the distance between v and u should be no less than l). On the other hand, they don't want the participants to freeze (so the distance between v and u should be no more than r). Besides, for every street we know its beauty — some integer from 0 to 109. Your task is to choose the path that fits in the length limits and has the largest average beauty. We shall define the average beauty as a median of sequence of the beauties of all roads along the path.

We can put it more formally like that: let there be a path with the length k. Let ai be a non-decreasing sequence that contains exactly k elements. Each number occurs there exactly the number of times a road with such beauty occurs along on path. We will represent the path median as number a⌊k / 2⌋, assuming that indexation starting from zero is used. ⌊x⌋ — is number х, rounded down to the nearest integer.

For example, if a = {0, 5, 12}, then the median equals to 5, and if a = {0, 5, 7, 12}, then the median is number 7.

It is guaranteed that there will be at least one path with the suitable quantity of roads.

Input

The first line contains three integers n, l, r (1 ≤ l ≤ r < n ≤ 105).

Next n - 1 lines contain descriptions of roads of the Nvodsk, each line contains three integers ai, bi, ci (1 ≤ ai, bi ≤ n, 0 ≤ ci ≤ 109, ai ≠ bi) — junctions ai and bi are connected with a street whose beauty equals ci.

Output

Print two integers — numbers of the junctions, where to accommodate the participants and set up the contests, correspondingly. If there are multiple optimal variants, print any of them.

Examples

Input

6 3 4
1 2 1
2 3 1
3 4 1
4 5 1
5 6 1


Output

4 1


Input

6 3 4
1 2 1
2 3 1
3 4 1
4 5 2
5 6 2


Output

6 3


Input

5 1 4
1 2 1
1 3 4
3 4 7
3 5 2


Output

4 3


Input

8 3 6
1 2 9
2 3 7
3 4 7
4 5 8
5 8 2
3 6 3
2 7 4


Output

5 1

Note

In the first sample all roads have the same beauty. That means that all paths of the positive length have the same median. Thus, any path with length from 3 to 4, inclusive will be valid for us.

In the second sample the city looks like that: 1 - 2 - 3 - 4 - 5 - 6. Two last roads are more valuable and we should choose any path that contains both of them and has the suitable length. It is either the path between 2 and 6 or the path between 3 and 6.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
std::mt19937 rng(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
struct Info {
  Info(int a = 0, int b = 0, int c = (int)1e9 + 1) : sum(a), h(b), lim(c) {}
  Info(Info info, int c)
      : sum(info.sum + (c >= info.lim ? 1 : -1)),
        h(info.h + 1),
        lim(info.lim) {}
  int sum, h, lim;
};
const int INF = 1e9;
template <class T, class C = std::less<T>>
struct MaxQueue {
  MaxQueue() { clear(); }
  void clear() {
    id = 0;
    q.clear();
  }
  void push(T x) {
    std::pair<int, T> nxt(1, x);
    while ((int)q.size() > id && cmp(q.back().second, x)) {
      nxt.first += q.back().first;
      q.pop_back();
    }
    q.push_back(nxt);
  }
  T qry() { return q[id].second; }
  void pop() {
    q[id].first--;
    if (q[id].first == 0) {
      id++;
    }
  }

 private:
  std::vector<std::pair<int, T>> q;
  int id;
  C cmp;
};
struct Solver {
  Solver(int left, int right) : L(left), R(right) {}
  std::pair<int, int> operator()(
      const std::vector<std::vector<std::pair<int, Info>>> &a) {
    int n = (int)a.size();
    if (curSize.empty()) {
      curSize.assign(n, 0);
      perm.resize(n);
      for (int i = 0; i < n; i++) {
        perm[i] = i;
        for (auto p : a[i]) {
          curSize[i] = std::max(curSize[i], p.second.h);
        }
      }
      std::sort(perm.begin(), perm.end(),
                [&](int v1, int v2) { return curSize[v1] < curSize[v2]; });
    }
    cur.clear();
    MaxQueue<std::pair<int, int>> q;
    for (auto tree : perm) {
      if (tree == 0) {
        assert(cur.empty());
        cur.emplace_back(0, a[0][0].first);
        continue;
      }
      assert(!cur.empty());
      next.assign(curSize[tree] + 1, std::pair<int, int>(-INF, -INF));
      for (auto p : a[tree]) {
        next[p.second.h] = std::max(next[p.second.h],
                                    std::pair<int, int>(p.second.sum, p.first));
      }
      int ptl = std::min(R, (int)cur.size()) - 1;
      int ptr = ptl;
      q.clear();
      for (int h = 1; h <= curSize[tree]; h++) {
        while (ptl >= 0 && L <= h + ptl && h + ptl <= R) {
          q.push(cur[ptl--]);
        }
        while (ptr > ptl && !(L <= h + ptr && h + ptr <= R)) {
          q.pop();
          ptr--;
        }
        if (ptr == -1) break;
        if (ptl < ptr && q.qry().first + next[h].first >= 0) {
          return std::pair<int, int>(q.qry().second, next[h].second);
        }
      }
      cur.resize(next.size(), std::pair<int, int>(-INF, -INF));
      for (int h = 1; h <= curSize[tree]; h++) {
        cur[h] = std::max(cur[h], next[h]);
      }
    }
    return std::pair<int, int>(-1, -1);
  }
  int L, R;
  std::vector<int> curSize, perm;
  std::vector<std::pair<int, int>> cur, next;
};
template <class Cost>
class CentroidDecomposition {
 public:
  struct Edge {
    Edge() {}
    Edge(int v, Cost cost) : to(v), c(cost) {}
    int to;
    Cost c;
  };
  CentroidDecomposition(int _n)
      : n(_n), edges(_n), tree(_n), col(_n, -1), size(_n), pt(_n, 0) {}
  void addEdge(int u, int v, Cost c) {
    edges[u].emplace_back(v, c);
    edges[v].emplace_back(u, c);
    pt[u]++, pt[v]++;
  }
  int init() {
    int ans = init(0, 0);
    for (int i = 0; i < n; i++) {
      std::sort(edges[i].begin(), edges[i].end(),
                [&](Edge e1, Edge e2) { return col[e1.to] > col[e2.to]; });
    }
    return ans;
  }
  int getCentroid() {
    preDFS(0, -1);
    return getCen(0);
  }
  template <class Info>
  std::vector<std::vector<std::pair<int, Info>>> getInfo(int i, Info base) {
    std::vector<std::pair<int, Info>> a;
    std::vector<std::vector<std::pair<int, Info>>> ans(
        1, std::vector<std::pair<int, Info>>(1, std::pair<int, Info>(i, base)));
    for (int j = 0; j < pt[i]; j++) {
      a.clear();
      dfs(a, edges[i][j].to, i, col[i], Info(base, edges[i][j].c));
      ans.push_back(a);
    }
    return ans;
  }
  template <class Info>
  void dfs(std::vector<std::pair<int, Info>> &vec, int on, int par, int lim,
           Info h) {
    vec.emplace_back(on, h);
    for (auto e : edges[on]) {
      if (e.to == par) continue;
      if (col[e.to] <= lim) break;
      dfs(vec, e.to, on, lim, Info(h, e.c));
    }
  }

 private:
  void preDFS(int on, int par) {
    size[on] = 1;
    for (int i = 0; i < pt[on]; i++) {
      int to = edges[on][i].to;
      if (col[to] != -1 || to == par) {
        std::swap(edges[on][i], edges[on][pt[on] - 1]);
        if (col[to] != -1) {
          pt[on]--;
          i--;
        } else if (i + 1 < pt[on]) {
          i--;
        }
        continue;
      }
      preDFS(to, on);
      size[on] += size[to];
      if (size[to] > size[edges[on][0].to]) {
        std::swap(edges[on][0], edges[on][i]);
      }
    }
  }
  int getCen(int on) {
    int sz = size[on];
    while (size[on] > 1 && 2 * size[edges[on][0].to] >= sz)
      on = edges[on][0].to;
    return on;
  }
  int init(int on, int c) {
    preDFS(on, -1);
    on = getCen(on);
    col[on] = c;
    for (auto e : edges[on]) {
      if (col[e.to] == -1) {
        tree[on].push_back(init(e.to, c + 1));
      }
    }
    return on;
  }
  int n;
  std::vector<std::vector<Edge>> edges;
  std::vector<std::vector<int>> tree;
  std::vector<int> col, size, pt;
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  int n, L, R;
  std::cin >> n >> L >> R;
  CentroidDecomposition<int> tree(n);
  for (int i = 1; i < n; i++) {
    int u, v, c;
    std::cin >> u >> v >> c;
    u--;
    v--;
    tree.addEdge(u, v, c);
  }
  tree.init();
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = i;
  }
  std::shuffle(a.begin(), a.end(), rng);
  int ans = -1;
  std::pair<int, int> wtf(-1, -1);
  for (auto on : a) {
    Solver solver(L, R);
    if (1 || solver(tree.getInfo(on, Info(0, 0, ans + 1))).first != -1) {
      int l = ans + 1, r = (int)1e9 + 1;
      while (l != r) {
        int mid = (l + r + 1) / 2;
        if (solver(tree.getInfo(on, Info(0, 0, mid))).first != -1) {
          l = mid;
        } else {
          r = mid - 1;
        }
      }
      auto kek = solver(tree.getInfo(on, Info(0, 0, l)));
      if (kek.first != -1) wtf = kek, ans = l;
    }
  }
  std::cerr << ans << '\n';
  std::cout << wtf.first + 1 << ' ' << wtf.second + 1 << '\n';
}