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 N = 100010;
int n, L, R, len[N], son[N], tar[N], dfn[N], cct, laz[N << 2], Mid;
pair<int, int> val[N << 2];
pair<int, pair<int, int> > ans;
inline void psd(int s) {
  val[s << 1 | 1].first += laz[s], laz[s << 1 | 1] += laz[s],
      val[s << 1].first += laz[s], laz[s << 1] += laz[s], laz[s] = 0;
}
void ope(int x, int y, int z, int s = 1, int l = 1, int r = n) {
  if (l == r) return (void)(val[s].first = y, val[s].second = z);
  int mid = l + r >> 1;
  psd(s);
  if (x <= mid)
    ope(x, y, z, s << 1, l, mid);
  else
    ope(x, y, z, s << 1 | 1, mid + 1, r);
  val[s] = max(val[s << 1], val[s << 1 | 1]);
}
void add(int x, int y, int z, int s = 1, int l = 1, int r = n) {
  if (l == x && r == y) return (void)(val[s].first += z, laz[s] += z);
  int mid = l + r >> 1;
  psd(s);
  if (y <= mid)
    add(x, y, z, s << 1, l, mid);
  else if (x > mid)
    add(x, y, z, s << 1 | 1, mid + 1, r);
  else
    add(x, mid, z, s << 1, l, mid), add(mid + 1, y, z, s << 1 | 1, mid + 1, r);
  val[s] = max(val[s << 1], val[s << 1 | 1]);
}
pair<int, int> que(int x, int y, int s = 1, int l = 1, int r = n) {
  if (l == x && r == y) return val[s];
  int mid = l + r >> 1;
  psd(s);
  if (y <= mid)
    return que(x, y, s << 1, l, mid);
  else if (x > mid)
    return que(x, y, s << 1 | 1, mid + 1, r);
  else
    return max(que(x, mid, s << 1, l, mid),
               que(mid + 1, y, s << 1 | 1, mid + 1, r));
}
struct node {
  int to, tar, nxt;
  node() {}
  node(int x, int y, int z) { to = x, tar = y, nxt = z; }
} tab[N << 1];
int head[N], tot = 2;
inline void ade(int x, int y, int z) {
  tab[tot] = node(y, z, head[x]), head[x] = tot++,
  tab[tot] = node(x, z, head[y]), head[y] = tot++;
}
void ini(int x, int f) {
  for (int i = head[x]; i; i = tab[i].nxt) {
    int t = tab[i].to;
    if (t == f) continue;
    ini(t, x), tar[t] = tab[i].tar, len[t] > len[son[x]] ? son[x] = t : 0;
  }
  len[x] = len[son[x]] + 1;
}
void ged(int x, int f) {
  dfn[x] = ++cct;
  if (son[x]) ged(son[x], x);
  for (int i = head[x]; i; i = tab[i].nxt)
    if (tab[i].to ^ f && tab[i].to ^ son[x]) ged(tab[i].to, x);
}
void dfs(int x, int f) {
  if (son[x]) dfs(son[x], x);
  for (int i = head[x]; i; i = tab[i].nxt) {
    int t = tab[i].to;
    if (t == f || t == son[x]) continue;
    dfs(t, x);
    for (int j = 0; j < len[t]; j++) {
      pair<int, int> p = que(dfn[t] + j, dfn[t] + j);
      int l = L - j - 1, r = R - j - 1;
      if (l >= 0 && l < len[x]) {
        pair<int, int> q =
            que(dfn[x] + l, min(dfn[x] + len[x] - 1, dfn[x] + r));
        if (p.first + q.first > ans.first)
          ans = make_pair(p.first + q.first, make_pair(p.second, q.second));
      }
    }
    for (int j = 0; j < len[t]; j++) {
      pair<int, int> p = que(dfn[t] + j, dfn[t] + j),
                     q = que(dfn[x] + j + 1, dfn[x] + j + 1);
      if (p.first > q.first) ope(dfn[x] + j + 1, p.first, p.second);
    }
  }
  if (L < len[x]) {
    pair<int, int> p = que(dfn[x] + L, min(dfn[x] + len[x] - 1, dfn[x] + R));
    if (p.first > ans.first) ans = make_pair(p.first, make_pair(x, p.second));
  }
  add(dfn[x], dfn[x] + len[x] - 1, tar[x] < Mid ? -1 : 1);
}
inline void clr() {
  ans = make_pair(-1e9, make_pair(0, 0));
  for (int i = 1; i <= n; i++) ope(dfn[i], 0, i);
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  for (int i = 1, x, y, z; i < n; i++)
    scanf("%d%d%d", &x, &y, &z), ade(x, y, z);
  ini(1, 0), ged(1, 0);
  int l = 0, r = 1e9;
  while (l < r)
    Mid = l + r >> 1, clr(), dfs(1, 0), ans.first >= 0 ? l = Mid + 1 : r = Mid;
  Mid = l - 1, clr(), dfs(1, 0),
  printf("%d %d\n", ans.second.first, ans.second.second);
}