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>
namespace IO {
char ibuf[(1 << 20)], *iS = ibuf + (1 << 20), *iT = ibuf + (1 << 20);
template <class T>
inline void read(T &x) {
  x = 0;
  int f = 0;
  char ch = ((iS == iT) ? (iT = (iS = ibuf) + fread(ibuf, 1, (1 << 20), stdin),
                           iS == iT ? EOF : *iS++)
                        : *iS++);
  for (; !isdigit(ch);
       f |= ch == '-',
       ch = ((iS == iT) ? (iT = (iS = ibuf) + fread(ibuf, 1, (1 << 20), stdin),
                          iS == iT ? EOF : *iS++)
                        : *iS++))
    ;
  for (; isdigit(ch);
       x = (x << 1) + (x << 3) + (ch ^ 48),
       ch = ((iS == iT) ? (iT = (iS = ibuf) + fread(ibuf, 1, (1 << 20), stdin),
                          iS == iT ? EOF : *iS++)
                        : *iS++))
    ;
  x = (f == 1 ? ~x + 1 : x);
}
char Out[(1 << 20)], *iter = Out;
template <class T>
inline void write(T x, char ch = '\n') {
  T l, c[35];
  if (x < 0) *iter++ = '-', x = ~x + 1;
  for (l = 0; !l || x; c[l] = x % 10, l++, x /= 10)
    ;
  for (; l; --l, *iter++ = c[l] + '0')
    ;
  *iter++ = ch;
  fwrite(Out, 1, iter - Out, stdout), iter = Out;
}
}  // namespace IO
using namespace IO;
using namespace std;
struct Edge {
  int x, y, w, v;
} e[100005 * 2];
int n, LL, RR, cnt, head[100005], nxt[100005 * 2], dep[100005], len[100005];
int son[100005], dfn[100005], tag[100005 * 4], ww[100005];
void AddEdge(int x, int y, int w) {
  e[++cnt] = (Edge){x, y, w, 0};
  nxt[cnt] = head[x];
  head[x] = cnt;
}
void Dfs1(int x, int fa) {
  dep[x] = len[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = e[i].y;
    if (y == fa) continue;
    Dfs1(y, x);
    len[x] = max(len[x], len[y]);
    if (len[son[x]] < len[y]) son[x] = y, ww[x] = e[i].w;
  }
}
void Dfs2(int x, int fa) {
  dfn[x] = ++dfn[0];
  if (son[x]) {
    Dfs2(son[x], x);
  }
  for (int i = head[x]; i; i = nxt[i]) {
    int y = e[i].y;
    if (y == fa || y == son[x]) continue;
    Dfs2(y, x);
  }
}
struct Node {
  int mx, t;
} sum[100005 * 4];
Node Max(Node x, Node y) { return (x.mx > y.mx ? x : y); }
inline void Pushdown(int k) {
  if (tag[k]) {
    tag[((k << 1))] += (tag[k]), sum[((k << 1))].mx += (tag[k]);
    tag[((k << 1 | 1))] += (tag[k]), sum[((k << 1 | 1))].mx += (tag[k]);
    tag[k] = 0;
  }
}
void Build(int k, int l, int r) {
  tag[k] = sum[k].t = 0, sum[k].mx = -n;
  if (l == r) return;
  int mid = (l + r) / 2;
  Build((k << 1), l, mid), Build((k << 1 | 1), mid + 1, r);
}
void Modify(int k, int l, int r, int x, Node v) {
  if (l == r) {
    sum[k] = Max(sum[k], v);
    return;
  }
  int mid = (l + r) / 2;
  Pushdown(k);
  (x <= mid ? Modify((k << 1), l, mid, x, v)
            : Modify((k << 1 | 1), mid + 1, r, x, v));
  sum[k] = Max(sum[(k << 1)], sum[(k << 1 | 1)]);
}
void Change(int k, int l, int r, int x, int y, int v) {
  if (x <= l && r <= y) {
    tag[(k)] += (v), sum[(k)].mx += (v);
    return;
  }
  int mid = (l + r) / 2;
  Pushdown(k);
  if (x <= mid) Change((k << 1), l, mid, x, y, v);
  if (y > mid) Change((k << 1 | 1), mid + 1, r, x, y, v);
  sum[k] = Max(sum[(k << 1)], sum[(k << 1 | 1)]);
}
Node Query(int k, int l, int r, int x, int y) {
  if (x <= l && r <= y) {
    return sum[k];
  }
  int mid = (l + r) / 2;
  Pushdown(k);
  if (y <= mid) return Query((k << 1), l, mid, x, y);
  if (x > mid) return Query((k << 1 | 1), mid + 1, r, x, y);
  return Max(Query((k << 1), l, mid, x, y),
             Query((k << 1 | 1), mid + 1, r, x, y));
}
int flag, xx, yy;
void Solve(int mid, int x, int fa) {
  if (flag) return;
  Modify(1, 1, n, dfn[x], (Node){0, x});
  if (!son[x]) return;
  Solve(mid, son[x], x);
  Change(1, 1, n, dfn[x] + 1, dfn[x] + len[x] - dep[x], ww[x] >= mid ? 1 : -1);
  if (LL < len[x] - dep[x] + 1) {
    Node ans =
        Query(1, 1, n, dfn[x] + LL, min(dfn[x] + RR, dfn[x] + len[x] - dep[x]));
    if (ans.mx >= 0) {
      flag = 1, xx = x, yy = ans.t;
      return;
    }
  }
  for (int i = head[x]; i; i = nxt[i]) {
    int y = e[i].y;
    if (y == fa || y == son[x]) continue;
    Solve(mid, y, x);
    int w = (e[i].w >= mid ? 1 : -1);
    for (int j = 1; j <= len[y] - dep[y] + 1; j++) {
      Node tmp = Query(1, 1, n, dfn[y] + j - 1, dfn[y] + j - 1);
      tmp.mx += w;
      if (LL - j >= len[x] - dep[x] + 1 || j > RR) continue;
      Node ans = Query(1, 1, n, dfn[x] + max(0, LL - j),
                       dfn[x] + min(len[x] - dep[x], RR - j));
      if (tmp.mx + ans.mx >= 0) {
        flag = 1, xx = tmp.t, yy = ans.t;
        break;
      }
    }
    for (int j = 1; j <= len[y] - dep[y] + 1; j++) {
      Node tmp = Query(1, 1, n, dfn[y] + j - 1, dfn[y] + j - 1);
      tmp.mx += w;
      Modify(1, 1, n, dfn[x] + j, tmp);
    }
  }
}
bool Check(int mid) {
  Build(1, 1, n);
  flag = 0;
  Solve(mid, 1, 0);
  return flag;
}
int val[100005];
int main() {
  read(n), read(LL), read(RR);
  for (int i = 1, x, y, w; i < n; i++) {
    read(x), read(y), read(w);
    AddEdge(x, y, w), AddEdge(y, x, w);
    val[i] = w;
  }
  Dfs1(1, 0), Dfs2(1, 0);
  sort(val + 1, val + n);
  int l = 1, r = unique(val + 1, val + n) - val - 1;
  int ansx = 0, ansy = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (Check(val[mid])) {
      l = mid + 1, ansx = xx, ansy = yy;
    } else
      r = mid - 1;
  }
  write(ansx, ' '), write(ansy);
  return 0;
}