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>
#pragma GCC optimize(2)
using namespace std;
void qread(int &x) {
  int neg = 1;
  x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = 10 * x + c - '0', c = getchar();
  x *= neg;
}
const int maxn = 100005;
int n, l, r, k, ans, ansu, ansv;
vector<pair<int, int> > edge[maxn];
vector<int> num;
int oriw[maxn], w[maxn], dep[maxn], lvl[maxn], son[maxn];
int pos[maxn], dis[maxn];
pair<int, int> val[maxn];
namespace Segtree {
int sz;
pair<int, int> t[maxn * 4];
void init(int _sz) {
  for (sz = 1; sz < _sz; sz <<= 1)
    ;
  for (int(i) = 0; (i) < sz << 1; i++) t[i] = make_pair(-1e9, -1e9);
}
void update(int v, pair<int, int> val) {
  v += sz - 1;
  t[v] = val;
  for (v >>= 1; v; v >>= 1) t[v] = max(t[v << 1], t[v << 1 | 1]);
}
pair<int, int> query(int l, int r) {
  pair<int, int> res = make_pair(-1e9, -1e9);
  for (l += sz - 1, r += sz - 1; l <= r; l >>= 1, r >>= 1) {
    if (l & 1) res = max(res, t[l]), l++;
    if ((r + 1) & 1) res = max(res, t[r]), r--;
  }
  return res;
}
}  // namespace Segtree
void prework1(int x, int p, int d) {
  dep[x] = lvl[x] = d;
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p) continue;
    prework1(y.first, x, d + 1);
    if (!son[x] || lvl[y.first] > lvl[son[x]]) son[x] = y.first;
    lvl[x] = max(lvl[x], lvl[y.first]);
  }
}
void prework2(int x, int p) {
  pos[x] = ++k;
  if (son[x]) prework2(son[x], x);
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    pair<int, int> y = edge[x][i];
    if (y.first == p || y.first == son[x]) continue;
    prework2(y.first, x);
  }
}
void work(int x, int p, int cur) {
  val[pos[x]] = make_pair(cur, x);
  dis[x] = cur;
  Segtree::update(pos[x], make_pair(cur, x));
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    int y = edge[x][i].first;
    if (y == son[x]) work(y, x, cur + w[edge[x][i].second]);
  }
  for (int(i) = 0; (i) < edge[x].size(); i++) {
    int y = edge[x][i].first;
    if (y == p || y == son[x]) continue;
    work(y, x, cur + w[edge[x][i].second]);
    int tmp = lvl[y] - dep[y];
    for (int(d) = 0; (d) < tmp + 1; d++) {
      int ql = max(l - d - 1, 0), qr = min(r - d - 1, lvl[x] - dep[x]);
      pair<int, int> val2 = Segtree::query(pos[x] + ql, pos[x] + qr);
      if (val[pos[y] + d].first + val2.first - 2 * dis[x] > ans) {
        ans = val[pos[y] + d].first + val2.first - 2 * dis[x];
        ansu = val[pos[y] + d].second;
        ansv = val2.second;
      }
    }
    for (int(d) = 0; (d) < tmp + 1; d++) {
      val[pos[x] + d + 1] = max(val[pos[x] + d + 1], val[pos[y] + d]);
      Segtree::update(pos[x] + d + 1, val[pos[x] + d + 1]);
    }
  }
  pair<int, int> val2 =
      Segtree::query(pos[x] + l, pos[x] + min(r, lvl[x] - dep[x]));
  if (val2.first - dis[x] > ans) {
    ans = val2.first - dis[x];
    ansu = x;
    ansv = val2.second;
  }
}
bool check(int x) {
  for (int(i) = 1; (i) <= n - 1; i++) {
    if (oriw[i] < x)
      w[i] = -1;
    else
      w[i] = 1;
  }
  Segtree::init(n);
  for (int(i) = 1; (i) <= n; i++) val[i] = make_pair(-1e9, -1e9);
  ans = -1e9;
  work(1, 0, 0);
  return ans >= 0;
}
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int(i) = 1; (i) <= n - 1; i++) {
    int u, v;
    scanf("%d%d%d", &u, &v, &oriw[i]);
    edge[u].push_back(make_pair(v, i));
    edge[v].push_back(make_pair(u, i));
    num.push_back(oriw[i]);
  }
  prework1(1, 0, 0);
  prework2(1, 0);
  sort(num.begin(), num.end());
  num.resize(unique(num.begin(), num.end()) - num.begin());
  int l = 0, r = num.size();
  while (r - l > 1) {
    int mid = (l + r) >> 1;
    if (check(num[mid]))
      l = mid;
    else
      r = mid;
  }
  check(num[l]);
  printf("%d %d\n", ansu, ansv);
  return 0;
}