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>
int x[2 * 101000], y[2 * 101000], z[2 * 101000],
    T(2), f[101000], n, L, R, s[101000], F[101000], D[101000], b[101000],
    Peo[101000], Max[101000], Stack[101000], _Stack[101000], StackT, Mid, Seqt,
    D2Max, _D2[101000], _D[101000], Ansx, Ansy, D2[101000];
struct pt {
  int f, y, d, z;
} Seq[20 * 101000];
bool cmp(pt a, pt b) {
  return a.f != b.f ? _Stack[a.f] < _Stack[b.f] : a.d < b.d;
}
int Dfs(int l) {
  int i, j, k, _, Min(1000000000), _Min, DMax;
  D[l] = 0;
  for (s[F[l] = i = 0] = l, j = 1; i < j; i++)
    for (k = f[s[i]]; k; k = x[k])
      if (y[k] != F[s[i]] && !b[y[k]]) {
        F[s[j++] = y[k]] = s[i];
        D[y[k]] = D[s[i]] + 1;
      }
  DMax = D[s[j - 1]] + 1;
  for (i = 0; i < j; i++) Peo[s[i]] = 1, Max[s[i]] = 0;
  for (i = j - 1; i >= 0; i--) {
    if (j - Peo[s[i]] > Max[s[i]]) Max[s[i]] = j - Peo[s[i]];
    if (Max[s[i]] < Min) {
      Min = Max[s[i]];
      _Min = s[i];
    }
    Peo[F[s[i]]] += Peo[s[i]];
    if (Peo[s[i]] > Max[F[s[i]]]) Max[F[s[i]]] = Peo[s[i]];
  }
  b[Stack[_Stack[_Min] = StackT++] = _Min] = 1;
  for (_ = f[_Min]; _; _ = x[_])
    if (!b[y[_]]) {
      Seqt++;
      Seq[Seqt - 1] = (pt){_Min, y[_], Dfs(y[_]), z[_]};
    }
  return DMax;
}
void Bfs(int X) {
  int i, j, k, l;
  D[l = Seq[X].y] = (Seq[X].z >= Mid) ? 1 : -1;
  D2[l] = 1;
  for (s[F[l] = i = 0] = l, j = 1; i < j; i++)
    for (k = f[s[i]]; k; k = x[k])
      if (y[k] != F[s[i]] && !b[y[k]]) {
        F[s[j++] = y[k]] = s[i];
        D[y[k]] = D[s[i]] + ((z[k] >= Mid) ? 1 : -1);
        D2[y[k]] = D2[s[i]] + 1;
      }
  for (i = 0; i <= Seq[X].d; i++) _D[i] = -1;
  for (i = 0; i < j; i++)
    if (_D[D2[s[i]]] == -1 || D[_D[D2[s[i]]]] < D[s[i]]) _D[D2[s[i]]] = s[i];
}
bool Check(int M) {
  memset(b, 0, sizeof b);
  int i, j, k, l, D2Max, h, t;
  Mid = M;
  for (i = j = 0; i < StackT; i++) {
    if (Stack[i] == 7) {
      Stack[i] = 7;
    }
    b[Stack[i]] = 1;
    D2Max = 0;
    for (; j < Seqt && _Stack[Seq[j].f] < i; j++)
      ;
    for (; j < Seqt && _Stack[Seq[j].f] == i; j++) {
      Bfs(j);
      h = t = 0;
      for (k = 1, l = D2Max; l > 0; l--) {
        for (; k + l <= R && k <= Seq[j].d; k++) {
          for (; h < t && D[_D[s[t - 1]]] <= D[_D[k]]; t--)
            ;
          s[t++] = k;
        }
        for (; h < t && s[h] + l < L; h++)
          ;
        if (h < t && D[_D2[l]] + D[_D[s[h]]] >= 0) {
          Ansx = _D2[l];
          Ansy = _D[s[h]];
          return 1;
        }
      }
      for (l = 1; l <= Seq[j].d; l++)
        if (l > D2Max || D[_D[l]] > D[_D2[l]]) {
          _D2[l] = _D[l];
          if (L <= l && l <= R && D[_D[l]] >= 0) {
            Ansx = _D[l];
            Ansy = Stack[i];
            return 1;
          }
        }
      D2Max = Seq[j].d;
    }
  }
  return 0;
}
void IN(int a, int b, int c) {
  x[T] = f[a];
  y[T] = b;
  z[T] = c;
  f[a] = T++;
}
int main() {
  int i, j, k, l, Left, Right;
  scanf("%d%d%d", &n, &L, &R);
  for (i = 1; i < n; i++) {
    scanf("%d%d%d", &j, &k, &l);
    IN(j, k, l);
    IN(k, j, l);
  }
  Dfs(1);
  std::sort(Seq, Seq + Seqt, cmp);
  Left = 0;
  Right = 1000000000;
  for (; Left + 1 < Right;)
    if (Check((Left + Right) / 2))
      Left = (Left + Right) / 2;
    else
      Right = (Left + Right) / 2;
  Check(Left);
  printf("%d %d\n", Ansx, Ansy);
  return 0;
}