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>
using namespace std;
const int DIM = 1e5 + 5;
int szt[DIM], dp1[DIM], dp2[DIM], lev[DIM];
vector<pair<int, int>> edg[DIM];
pair<int, int> lst[DIM], axl[DIM];
bitset<DIM> oki, axo;
vector<int> aux, cen;
inline int g(int x, int y) { return (x >= y) ? 1 : -1; }
void findcent(int x, int f, int sz, int &c) {
  int mx = 0;
  szt[x] = lev[x] = 1;
  for (pair<int, int> y : edg[x]) {
    if (y.first == f or oki[y.first]) continue;
    findcent(y.first, x, sz, c);
    lev[x] = max(lev[x], 1 + lev[y.first]);
    mx = max(mx, szt[y.first]);
    szt[x] += szt[y.first];
  }
  mx = max(mx, sz - szt[x]);
  if (mx <= sz / 2) c = x;
}
void predfs(int x, int sz) {
  findcent(x, 0, sz, x);
  findcent(x, 0, sz, x);
  sort(edg[x].begin(), edg[x].end(), [](pair<int, int> e1, pair<int, int> e2) {
    return lev[e1.first] < lev[e2.first];
  });
  cen.push_back(x);
  oki[x] = true;
  for (pair<int, int> y : edg[x])
    if (!oki[y.first]) predfs(y.first, szt[y.first]);
}
void dfs(int x, int f, int val, int l, int c, int &nr, int r) {
  if (l > r) return;
  if (!axo[l]) axl[l] = make_pair(c, x), nr = l, axo[l] = true;
  if (axl[l].first < c) axl[l] = make_pair(c, x);
  for (pair<int, int> y : edg[x])
    if (y.first != f and !oki[y.first])
      dfs(y.first, x, val, l + 1, c + g(y.second, val), nr, r);
}
pair<int, int> solve(int val, int l, int r) {
  for (int x : cen) {
    oki[x] = true;
    if (szt[x] <= l) continue;
    int len = 0;
    lst[0] = make_pair(0, x);
    dp1[0] = dp2[0] = 0;
    for (pair<int, int> y : edg[x]) {
      if (oki[y.first]) continue;
      int nr = 0;
      for (int i = 1; axo[i]; ++i) axo[i] = 0;
      dfs(y.first, x, val, 1, g(y.second, val), nr, r);
      for (int i = 1; i <= min(nr, r); ++i) {
        int pos1 = max(0, l - i), pos2 = r - i;
        if (pos2 > len) {
          if (axl[i].first + lst[dp2[pos1]].first >= 0 and pos1 <= len)
            return make_pair(axl[i].second, lst[dp2[pos1]].second);
        } else {
          if (axl[i].first + lst[dp1[pos2]].first >= 0)
            return make_pair(axl[i].second, lst[dp1[pos2]].second);
        }
      }
      for (int i = 1; i <= nr; ++i) {
        if (i > len) lst[++len] = make_pair(-1e9, -1e9);
        if (lst[i].first < axl[i].first) lst[i] = axl[i];
      }
      deque<int> que;
      for (int i = 0; i <= len; ++i) {
        while (que.size() and lst[que.back()].first < lst[i].first)
          que.pop_back();
        que.push_back(i);
        if (que.front() == i - (r - l + 1)) que.pop_front();
        dp1[i] = que.front();
      }
      for (int i = len; i >= 0; --i) {
        dp2[i] = i;
        if (i < len and lst[i].first < lst[dp2[i + 1]].first)
          dp2[i] = dp2[i + 1];
      }
    }
  }
  return make_pair(-1, -1);
}
int main(void) {
  ios ::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n, l, r;
  cin >> n >> l >> r;
  for (int i = 1; i < n; ++i) {
    int x, y, c;
    cin >> x >> y >> c;
    aux.push_back(c);
    edg[x].push_back(make_pair(y, c));
    edg[y].push_back(make_pair(x, c));
  }
  sort(aux.begin(), aux.end());
  predfs(1, n);
  aux.resize(unique(aux.begin(), aux.end()) - aux.begin());
  pair<int, int> val;
  for (int le = 0, ri = (int)aux.size() - 1; le <= ri;) {
    int md = (le + ri) >> 1;
    oki.reset();
    pair<int, int> axv = solve(aux[md], l, r);
    if (axv.first == -1)
      ri = md - 1;
    else
      le = md + 1, val = axv;
  }
  cout << val.first << " " << val.second << endl;
  return 0;
}