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 oo = 10000001;
const int N = 100005;
int n, L, R, ss, be, bi, maxd, nowd, ans, lim, rr, ansx, ansy;
int h[N], u[N], s[N], q[N], ne[N * 2], po[N * 2], w[N * 2];
pair<int, int> f[N], g[N];
void getss(int i, int fa) {
  ++ss;
  for (int j = h[i], k; k = po[j], j; j = ne[j])
    if (k != fa && !u[k]) getss(k, i);
}
void getbe(int i, int fa) {
  int t = 0;
  s[i] = 1;
  for (int j = h[i], k; k = po[j], j; j = ne[j])
    if (k != fa && !u[k]) getbe(k, i), s[i] += s[k], t = max(t, s[k]);
  t = max(t, ss - s[i]);
  if (t < be) be = t, bi = i;
}
void dfs(int i, int fa, int d, int s) {
  if (d <= R) {
    if (d > nowd) nowd = d;
    if (s > g[d].first) g[d] = make_pair(s, i);
  }
  for (int j = h[i], k; k = po[j], j; j = ne[j])
    if (k != fa && !u[k]) dfs(k, i, d + 1, s + ((w[j]) >= lim ? 1 : -1));
}
bool check() {
  maxd = 0;
  f[0] = g[0] = make_pair(0, bi);
  for (int j = h[bi], k; k = po[j], j; j = ne[j])
    if (!u[k]) {
      while (nowd) {
        if (g[nowd] > f[nowd]) f[nowd] = g[nowd];
        g[nowd--].first = -oo;
      }
      dfs(k, bi, 1, ((w[j]) >= lim ? 1 : -1));
      int st = 1, ed = 0, x = 0;
      for (int i = nowd; i; --i) {
        while (i + x <= R && x <= maxd) {
          while (st <= ed && f[x] > f[q[ed]]) --ed;
          q[++ed] = x++;
        }
        while (st <= ed && q[st] + i < L) ++st;
        if (st <= ed)
          if (f[q[st]].first + g[i].first >= 0) {
            if (lim > ans)
              ans = lim, ansx = f[q[st]].second, ansy = g[i].second;
            return 1;
          }
      }
      if (nowd > maxd) {
        for (int i = maxd + 1; i <= nowd; ++i) f[i].first = -oo;
        maxd = nowd;
      }
    }
  return 0;
}
void work(int i) {
  ss = 0;
  getss(i, 0);
  be = n + 1;
  bi = 0;
  getbe(i, 0);
  int l = 0, r = rr;
  while (l < r) {
    int m = (l + r + 1) >> 1;
    lim = m;
    if (check())
      l = m;
    else
      r = m - 1;
  }
  lim = l;
  check();
  u[bi] = 1;
  for (int j = h[bi], k; k = po[j], j; j = ne[j])
    if (!u[k]) work(k);
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  int e = 0;
  for (int i = 1; i < n; ++i) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    ++e;
    ne[e] = h[x];
    po[e] = y;
    w[e] = z;
    h[x] = e;
    ++e;
    ne[e] = h[y];
    po[e] = x;
    w[e] = z;
    h[y] = e;
    rr = max(rr, z);
  }
  for (int i = 0; i <= n; ++i) f[i].first = g[i].first = -oo;
  ans = -1;
  work(1);
  printf("%d %d\n", ansx, ansy);
  return 0;
}