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 mn = 101000, inf = 1 << 30;
int n, m, L, R, len, ans = 0, st, ed, mi;
int sa[mn], f[mn], s[mn], px[mn], py[mn], q[mn];
int tt, po[mn], w[mn], g[mn], que[mn], fa[mn], dis[mn], dep[mn];
bool del[mn];
struct list {
  int la[mn], next[mn * 2], y[mn * 2], v[mn * 2], tt;
  void add(int i, int j, int k) {
    next[++tt] = la[i], la[i] = tt, y[tt] = j, v[tt] = k;
  }
} e;
int root(int st, int size) {
  int r = 1, h = 1, p, i, j, res;
  que[1] = st, fa[st] = 0, s[st] = 1;
  while (r <= h) {
    for (i = que[r++], p = e.la[i]; p; p = e.next[p]) {
      j = e.y[p];
      if (del[j] || j == fa[i]) continue;
      s[j] = 1, fa[j] = i, que[++h] = j;
    }
  }
  res = que[h];
  for (r = h; r >= 1; --r) {
    i = que[r], f[i] = 0;
    for (p = e.la[i]; p; p = e.next[p]) {
      j = e.y[p];
      if (del[j] || j == fa[i]) continue;
      s[i] += s[j], f[i] = max(f[i], s[j]);
    }
    f[i] = max(f[i], size - f[i]);
    if (f[i] < f[res]) res = i;
  }
  return res;
}
bool cmp(int i, int j) { return s[i] < s[j]; }
void bfs(int st) {
  int r = 1, h = 1, p, i, j;
  que[1] = st, fa[st] = 0;
  while (r <= h) {
    i = que[r++];
    if (dis[i] > g[dep[i]]) g[dep[i]] = dis[i], py[dep[i]] = i;
    for (p = e.la[i]; p; p = e.next[p]) {
      j = e.y[p];
      if (j == fa[i] || del[j]) continue;
      fa[j] = i, dep[j] = dep[i] + 1, que[++h] = j;
      if (e.v[p] >= mi)
        dis[j] = dis[i] + 1;
      else
        dis[j] = dis[i] - 1;
    }
  }
}
bool check(int r, int mid) {
  int i, j, v, k = 0, qh, qt;
  px[0] = r, mi = sa[mid];
  for (i = 1; i <= s[po[tt]]; ++i) f[i] = -inf;
  for (i = 1; i <= tt; ++i) {
    v = po[i];
    for (j = 1; j <= s[v]; ++j) g[j] = -inf;
    dis[v] = w[v] >= mi ? 1 : -1, dep[v] = 1;
    bfs(v);
    qh = 1, qt = 0;
    for (j = 1; j <= s[v]; ++j) {
      while (k >= 0 && j + k >= L) {
        while (qh <= qt && f[q[qt]] < f[k]) --qt;
        q[++qt] = k;
        --k;
      }
      while (qh <= qt && q[qh] + j > R) ++qh;
      if (qh <= qt && g[j] + f[q[qh]] >= 0) {
        if (mid > ans) ans = mid, st = px[q[qh]], ed = py[j];
        return 1;
      }
    }
    for (k = 1; k <= j - 1; ++k)
      if (f[k] < g[k]) f[k] = g[k], px[k] = py[k];
    k = j - 1;
  }
  return 0;
}
void calc(int r, int size) {
  int p, i;
  tt = 0;
  for (p = e.la[r]; p; p = e.next[p]) {
    i = e.y[p];
    if (del[i]) continue;
    if (s[i] > s[r]) s[i] = size - s[r];
    po[++tt] = i, w[i] = e.v[p];
  }
  if (!tt) return;
  sort(po + 1, po + 1 + tt, cmp);
  int lo = ans, hi = len, m;
  while (lo < hi) {
    m = (lo + hi + 1) / 2;
    if (check(r, m))
      lo = m;
    else
      hi = m - 1;
  }
  check(r, lo);
}
void solve(int u, int size) {
  int p, r = root(u, size);
  del[r] = 1;
  calc(r, size);
  for (p = e.la[r]; p; p = e.next[p])
    if (!del[e.y[p]]) solve(e.y[p], s[e.y[p]]);
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  int i, x, y, z;
  for (i = 1; i <= n - 1; ++i) {
    scanf("%d%d%d", &x, &y, &z);
    e.add(x, y, z), e.add(y, x, z);
    sa[i] = z;
  }
  sort(sa + 1, sa + n), len = unique(sa + 1, sa + n) - sa - 1;
  sa[len + 1] = inf;
  solve(1, n);
  printf("%d %d\n", st, ed);
  return 0;
}