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 inf = (int)1e9;
int i, j, m, n, p, k, fox[100005], Q[100005], k1, L, R, x, y, z, Max, ansx,
    ansy, idx, idy, Sum[100005], Ql, Qr;
int vis[100005], Rt[100005], b[100005], fa[100005], size[100005], Relx,
    deep[100005], sum[100005], Maxdeep[100005];
int sky[100005], id[100005], Supper[100005], Sup[100005], Que[100005], NowAns;
struct Node {
  int ed, before, cost;
} s[100005 * 2];
void add(int x, int y, int z) {
  s[++k1].ed = y;
  s[k1].before = fox[x];
  fox[x] = k1;
  s[k1].cost = z;
}
int getroot(int x) {
  Q[Q[0] = 1] = x;
  Rt[x] = 1;
  fa[x] = 0;
  for (int i = 1; i <= Q[0]; i++) {
    int p = Q[i];
    for (int j = fox[p]; j; j = s[j].before) {
      int A = s[j].ed;
      if (vis[A] || Rt[A]) continue;
      Q[++Q[0]] = A;
      fa[A] = p;
      Rt[A] = 1;
    }
  }
  int A1 = 0, A2 = 1000000;
  for (int i = Q[0]; i; i--) {
    int p = Q[i];
    size[p] = 1;
    int Max = -1;
    for (int j = fox[p]; j; j = s[j].before) {
      int A = s[j].ed;
      if (vis[A] || fa[p] == A) continue;
      Max = max(Max, size[A]);
      size[p] += size[A];
    }
    Max = max(Max, Q[0] - size[p]);
    if (Max < A2) {
      A1 = p;
      A2 = Max;
    }
  }
  for (int i = 1; i <= Q[0]; i++) Rt[Q[i]] = 0;
  return A1;
}
void bfs(int x) {
  int i, j;
  Q[Q[0] = 1] = x;
  Rt[x] = 1;
  deep[x] = 0;
  sum[x] = 0;
  fa[x] = 0;
  for (i = 1; i <= Q[0]; i++) {
    int p = Q[i];
    for (j = fox[p]; j; j = s[j].before)
      if (!(vis[s[j].ed] || Rt[s[j].ed])) {
        int A = s[j].ed;
        deep[A] = deep[p] + 1;
        fa[A] = p;
        sum[A] = sum[p] + (s[j].cost >= Relx ? 1 : -1);
        Q[++Q[0]] = A;
        Rt[A] = 1;
      }
  }
  for (i = Q[0]; i; --i) {
    Maxdeep[Q[i]] = deep[Q[i]];
    for (j = fox[Q[i]]; j; j = s[j].before)
      if (fa[s[j].ed] == Q[i])
        Maxdeep[Q[i]] = max(Maxdeep[Q[i]], Maxdeep[s[j].ed]);
  }
  for (i = 1; i <= Q[0]; ++i) Rt[Q[i]] = fa[Q[i]] = 0;
}
inline bool cmp(int a, int b) { return Maxdeep[a] < Maxdeep[b]; }
void checkin(int x) {
  int y = deep[x];
  if (Supper[y] < sum[x]) Supper[y] = sum[x], Sup[y] = x;
}
int Get(int x) {
  int i, j;
  Q[Q[0] = 1] = x;
  Rt[x] = 1;
  for (i = 1; i <= Q[0]; i++) {
    int p = Q[i];
    checkin(p);
    for (j = fox[p]; j; j = s[j].before)
      if (!(vis[s[j].ed] || Rt[s[j].ed])) {
        int A = s[j].ed;
        Q[++Q[0]] = A;
        Rt[A] = 1;
      }
  }
  for (i = 1; i <= Q[0]; ++i) Rt[Q[i]] = fa[Q[i]] = 0;
  return deep[Q[Q[0]]];
}
void Up(int x, int y, int z) {
  if (x > Max) {
    Max = x;
    idx = y;
    idy = z;
  }
}
void insert(int x) {
  while (Ql <= Qr && Sum[x] > Sum[Que[Qr]]) --Qr;
  Que[++Qr] = x;
}
void Fen(int x) {
  int i, j;
  int root = getroot(x);
  vis[root] = 1;
  int l = NowAns, r = b[0] + 1, mid = 0;
  while ((l + r) >> 1 != mid) {
    mid = (l + r) >> 1;
    Max = -1;
    Relx = b[mid];
    bfs(root);
    sky[0] = 0;
    for (i = fox[root]; i; i = s[i].before)
      if (!vis[s[i].ed]) sky[++sky[0]] = s[i].ed;
    sort(sky + 1, sky + sky[0] + 1, cmp);
    int realsum = 0, nowl, reall;
    for (i = 1; i <= sky[0]; ++i) {
      reall = realsum;
      int Rec = Get(sky[i]);
      for (j = L; j <= R; ++j)
        if (j > Rec)
          break;
        else
          Up(Supper[j], Sup[j], root);
      Ql = 1, Qr = 0;
      for (j = 1; j <= Rec; ++j) {
        while (reall && reall + j >= L) insert(reall--);
        while (Ql <= Qr && Que[Ql] + j > R) ++Ql;
        if (Ql > Qr) continue;
        Up(Sum[Que[Ql]] + Supper[j], Sup[j], id[Que[Ql]]);
      }
      for (j = 1; j <= Rec; ++j) {
        if (Sum[j] < Supper[j]) {
          Sum[j] = Supper[j];
          id[j] = Sup[j];
        }
        Supper[j] = -inf;
      }
      realsum = Rec;
    }
    for (i = 1; i <= realsum; ++i) Sum[i] = -inf;
    if (Max >= 0) {
      l = mid;
      ansx = idx;
      ansy = idy;
    } else
      r = mid;
  }
  NowAns = l;
  for (i = fox[root]; i; i = s[i].before)
    if (!vis[s[i].ed]) Fen(s[i].ed);
}
int read() {
  int x = 0;
  char c;
  while (c = getchar(), (c < '0' || c > '9'))
    ;
  x = c - '0';
  while (c = getchar(), (c >= '0' && c <= '9')) x = x * 10 + c - '0';
  return x;
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  for (i = 1; i <= n; ++i) Sum[i] = Supper[i] = -inf;
  for (i = 1; i < n; ++i) {
    x = read();
    y = read();
    z = read();
    add(x, y, z);
    add(y, x, z);
    b[++b[0]] = z;
  }
  sort(b + 1, b + b[0] + 1);
  b[0] = unique(b + 1, b + b[0] + 1) - (b + 1);
  Fen(1);
  printf("%d %d\n", ansx, ansy);
}