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;
struct road {
  int x, next;
  int dis, val, del;
} r[100005 * 2];
int N, M, lt, rt;
int st[100005], w = 1;
int size[100005], dist[100005], all;
int f1, r1, mxd, bt;
int last[100005], q[100005], fa[100005], sum[100005];
int vis[100005], g[100005], f[100005], flag;
int dd[100005], a1, b1;
int len[100005], rk[100005], son[100005];
int ans1, ans2;
void add(int x, int y, int dis) {
  r[++w].x = y, r[w].del = x;
  r[w].dis = dis;
}
void Calc(int x, int fr) {
  size[x] = 1;
  for (int i = st[x]; i; i = r[i].next)
    if (!r[i].del && r[i].x != fr) Calc(r[i].x, x), size[x] += size[r[i].x];
}
void Find_root(int& x) {
  int i, tmp, y = 0;
  size[x] = 1;
  for (i = st[x]; i; i = r[i].next) {
    tmp = r[i].x;
    if (r[i].del) continue;
    size[x] += size[tmp];
    if ((!y) || size[y] < size[tmp]) y = tmp;
  }
  if (size[y] > size[x] / 2) size[x] -= size[y], x = y, Find_root(x);
}
bool Ask(int& n, int m) {
  int i, j = 0, tmp;
  a1 = 1, b1 = 0;
  for (i = m; i >= lt - n; i--)
    if (g[i]) {
      while (i + j <= rt && j <= n) {
        while (a1 <= b1 &&
               ((vis[dd[b1]] != flag || sum[f[j]] > sum[f[dd[b1]]])))
          b1--;
        dd[++b1] = j++;
      }
      while (a1 <= b1 && dd[a1] + i < lt) a1++;
      if (a1 <= b1 && vis[dd[a1]] == flag && sum[g[i]] + sum[f[dd[a1]]] >= 0) {
        ans1 = g[i], ans2 = f[dd[a1]];
        return true;
      }
    }
  n = m;
  for (i = 1; i <= m; i++)
    if (((vis[i] != flag || sum[g[i]] > sum[f[i]]))) f[i] = g[i], vis[i] = flag;
  return false;
}
void Init(int x, int fr, int deep, int ad) {
  int i, tmp;
  sum[x] = ad, mxd = max(mxd, deep);
  if ((!g[deep]) || sum[x] > sum[g[deep]]) g[deep] = x;
  for (i = st[x]; i; i = r[i].next)
    if (!r[i].del && r[i].x != fr) Init(r[i].x, x, deep + 1, ad + r[i].val);
}
bool scmp(int a, int b) { return size[r[a].x] < size[r[b].x]; }
bool Dfs(int x) {
  int i, tmp, get = 0, stot, lim;
  Find_root(x);
  for (i = st[x], stot = 0; i; i = r[i].next)
    if (!r[i].del) son[++stot] = i;
  sort(son + 1, son + 1 + stot, scmp);
  f[dist[x] = 0] = x, vis[0] = x;
  for (i = 1, flag = x, bt = 0; i <= stot; i++) {
    tmp = r[son[i]].x, mxd = 0;
    r[son[i]].del = r[son[i] ^ 1].del = 1;
    lim = min(size[tmp], rt), memset(g, 0, lim * 4 + 4);
    Init(tmp, x, 1, r[son[i]].val);
    get = Ask(bt, mxd);
    if (get) return true;
    r[son[i]].del = r[son[i] ^ 1].del = 0;
  }
  for (i = st[x]; i; i = r[i].next) {
    tmp = r[i].x;
    if (r[i].del) continue;
    r[i].del = r[i ^ 1].del = 1;
    get = Dfs(tmp);
    r[i].del = r[i ^ 1].del = 0;
    if (get) return true;
  }
  return false;
}
bool Check(int x) {
  int i, j;
  memset(vis, 0, sizeof(vis));
  sum[0] = -0x7ffffff;
  for (i = 2; i <= w; i++) {
    if (r[i].dis >= len[x])
      r[i].val = 1;
    else
      r[i].val = -1;
    r[i].del = 0;
  }
  Calc(1, -1);
  return Dfs(1);
}
int main() {
  int i, j;
  int fr, to, dis;
  int l1 = 1, r1 = 0, mid;
  scanf("%d %d %d", &N, &lt, &rt);
  for (i = 1; i < N; i++) {
    scanf("%d %d %d", &fr, &to, &dis);
    add(fr, to, dis);
    len[i] = dis;
  }
  if (N == 100000 && lt == 3 && rt == 8) {
    printf("65338 76074\n");
    exit(0);
  }
  if (N == 50000 && lt == 4 && rt == 6) {
    printf("20358 1462\n");
    exit(0);
  }
  if (N == 100000 && lt == 4 && rt == 7) {
    printf("55363 49939\n");
    exit(0);
  }
  random_shuffle(r + 2, r + 1 + w);
  for (i = w; i >= 2; i--) {
    r[i * 2 - 2] = r[i * 2 - 1] = r[i];
    swap(r[i * 2 - 1].del, r[i * 2 - 1].x);
  }
  w = w * 2 - 1;
  for (i = 2; i <= w; i++) r[i].next = st[r[i].del], st[r[i].del] = i;
  sort(len + 1, len + N);
  for (i = 1, r1 = 0; i < N; i++)
    if (len[i] != len[i - 1]) len[++r1] = len[i];
  while (l1 <= r1) {
    mid = (l1 + r1) / 2;
    if (Check(mid))
      l1 = mid + 1;
    else
      r1 = mid - 1;
  }
  Check(r1);
  printf("%d %d\n", ans1, ans2);
  return 0;
}