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;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * 1 % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int fst[200010], nxt[500010], vv[500010], cost[500010], e;
int dfn[200010], fa[200010], cnt[200010], dep[200010];
int mx1[200010], mx2[200010], id1[200010], id2[200010], ans, ansu, ansv, nowu,
    nowv, nowa;
int sz[200010], ch[200010], chnum, del[200010], rt;
int ll, rr, n, m, fckn, d1, d2;
void init() {
  e = 0;
  memset(fst, -1, sizeof fst);
}
void add(int u, int v, int c) {
  vv[e] = v, nxt[e] = fst[u], cost[e] = c, fst[u] = e++;
  vv[e] = u, nxt[e] = fst[v], cost[e] = c, fst[v] = e++;
}
bool check() {
  static int q[200010];
  int h = 0, t = 0;
  int mxd = d1;
  for (int i = 0; i <= d2; i++) {
    while (mxd >= 0 && mxd + i >= ll) {
      while (h < t && mx1[mxd] >= mx1[q[t - 1]]) t--;
      q[t++] = mxd;
      mxd--;
    }
    while (h < t && q[h] + i > rr) h++;
    if (h < t && mx1[q[h]] + mx2[i] >= 0) {
      nowu = id1[q[h]];
      nowv = id2[i];
      return true;
    }
  }
  return false;
}
void dfs(int u, int ff, int mid, int c, int d) {
  dfn[++fckn] = u;
  fa[u] = ff;
  dep[u] = d, cnt[u] = c;
  sz[u] = 1;
  for (int i = fst[u]; ~i; i = nxt[i]) {
    int v = vv[i];
    if (v == ff || del[v]) continue;
    dfs(v, u, mid, c + (cost[i] >= mid ? 1 : -1), d + 1);
    sz[u] += sz[v];
  }
}
bool cmp(int a, int b) { return sz[a] < sz[b]; }
void solve(int rt) {
  fckn = 0;
  dfs(rt, -1, -1, 0, 0);
  int zp = 0, mi = 0x3f3f3f3f;
  for (int i = 1; i <= fckn; i++) {
    int u = dfn[i];
    int tmp = sz[rt] - sz[u];
    for (int j = fst[u]; ~j; j = nxt[j]) {
      int v = vv[j];
      if (v == fa[u] || del[v]) continue;
      tmp = max(tmp, sz[v]);
    }
    if (tmp < mi) mi = tmp, zp = u;
  }
  chnum = 0;
  rt = zp;
  del[rt] = 1;
  fckn = 0;
  dfs(rt, -1, -1, 0, 0);
  for (int i = fst[rt]; ~i; i = nxt[i]) {
    int v = vv[i];
    if (del[v]) continue;
    ch[chnum++] = v;
  }
  sort(ch, ch + chnum, cmp);
  bool ok;
  int l = -1, r = 1e9 + 1;
  while (l < r - 1) {
    int mid = (l + r) / 2;
    d1 = 0;
    mx1[0] = 0, id1[0] = rt;
    for (int i = fst[rt]; ~i; i = nxt[i]) {
      int v = vv[i];
      if (del[v]) continue;
      cnt[v] = cost[i] >= mid ? 1 : -1;
    }
    ok = 0;
    for (int i = 0; i < chnum; i++) {
      int u = ch[i];
      fckn = 0;
      d2 = 0;
      dfs(u, -1, mid, cnt[u], 1);
      for (int j = 1; j <= fckn; j++) d2 = max(d2, dep[dfn[j]]);
      for (int j = 0; j <= d2; j++) mx2[j] = -0x3f3f3f3f;
      for (int j = 1; j <= fckn; j++) {
        int v = dfn[j];
        if (cnt[v] > mx2[dep[v]]) {
          mx2[dep[v]] = cnt[v];
          id2[dep[v]] = v;
        }
      }
      if (check()) {
        ok = 1;
        break;
      }
      for (int j = 0; j <= d2; j++) {
        if (j > d1 || mx2[j] > mx1[j]) {
          mx1[j] = mx2[j];
          id1[j] = id2[j];
        }
      }
      d1 = max(d1, d2);
    }
    if (ok) {
      l = mid;
    } else
      r = mid;
  }
  if (l >= ans) ans = l, ansu = nowu, ansv = nowv;
  for (int i = fst[rt]; ~i; i = nxt[i]) {
    int v = vv[i];
    if (!del[v]) solve(v);
  }
}
int main() {
  scanf("%d%d%d", &n, &ll, &rr);
  init();
  for (int i = 1; i < n; i++) {
    int u, v, c;
    scanf("%d%d%d", &u, &v, &c);
    add(u, v, c);
  }
  solve(1);
  printf("%d %d\n", ansu, ansv);
  return 0;
}