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 = 100005;
int n, L, R, pos[N], sz, rt, s[N], f[N], q[N], hd, tl, m = N, a1, a2;
int a[N], b[N], az, bz, res, siz, p[N], d[N], dz, ax[N], bx[N], w[N];
bool don[N];
struct edge {
  int y, nex, z;
} g[N * 2];
void init(int x, int y, int z) { g[++sz] = (edge){y, pos[x], z}, pos[x] = sz; }
bool cmp(int x, int y) { return s[x] < s[y]; }
void find(int x, int fa) {
  s[x] = 1;
  for (int i = pos[x]; i; i = g[i].nex) {
    if (g[i].y != fa && !don[g[i].y]) find(g[i].y, x), s[x] += s[g[i].y];
  }
}
void get(int x, int fa) {
  f[x] = 0;
  for (int i = pos[x]; i; i = g[i].nex) {
    if (g[i].y != fa && !don[g[i].y])
      get(g[i].y, x), f[x] = max(f[x], s[g[i].y]);
  }
  f[x] = max(f[x], siz - s[x]);
  if (f[rt] > f[x]) rt = x;
}
void dfs(int x, int fa, int l, int z) {
  bz = max(bz, l);
  if (b[l] < z) b[l] = z, bx[l] = x;
  for (int i = pos[x]; i; i = g[i].nex) {
    if (g[i].y != fa && !don[g[i].y])
      dfs(g[i].y, x, l + 1, z + (g[i].z >= p[m] ? 1 : -1));
  }
}
void check() {
  hd = 1, tl = 0;
  for (int i = min(az, R); i >= L; i--) {
    while (hd <= tl && a[i] > a[q[tl]]) tl--;
    q[++tl] = i;
  }
  for (int i = 1; i <= bz; i++) {
    if (i + az >= L && i <= L) {
      int k = L - i;
      while (hd <= tl && a[k] > a[q[tl]]) tl--;
      q[++tl] = k;
    }
    if (hd <= tl && q[hd] + i > R) hd++;
    if (hd <= tl && a[q[hd]] + b[i] >= 0) {
      a1 = ax[q[hd]], a2 = bx[i];
      res = 1;
    }
  }
  for (int i = 1; i <= bz; i++) {
    if (a[i] < b[i]) a[i] = b[i], ax[i] = bx[i];
    b[i] = -n;
  }
  az = max(az, bz);
  bz = 0;
}
void work(int x) {
  don[x] = 1;
  ax[0] = x;
  for (int i = 1; i <= az; i++) a[i] = -n;
  az = dz = 0;
  for (int i = pos[x]; i; i = g[i].nex)
    if (!don[g[i].y]) {
      find(g[i].y, x);
      d[++dz] = g[i].y, w[g[i].y] = (g[i].z >= p[m] ? 1 : -1);
    }
  sort(d + 1, d + dz + 1, cmp);
  for (int i = 1; i <= dz; i++) {
    dfs(d[i], x, 1, w[d[i]]);
    check();
  }
  for (int i = pos[x]; i; i = g[i].nex) {
    if (don[g[i].y]) continue;
    siz = s[g[i].y], get(g[i].y, rt = 0);
    work(rt);
  }
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  for (int i = 1; i <= n - 1; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    init(x, y, z), init(y, x, z);
    p[i] = z;
  }
  sort(p + 1, p + n);
  int l = 1, r = n - 1;
  f[0] = n + 1;
  while (l < r || l < m) {
    m = (l + r + 1) >> 1;
    res = 0, siz = n;
    for (int i = 1; i <= n; i++) don[i] = 0, b[i] = -n, a[i] = -n;
    find(1, 0), get(1, rt = 0), work(rt);
    if (res)
      l = m;
    else
      r = m - 1;
  }
  printf("%d %d\n", a1, a2);
  return 0;
}