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;
template <class D>
void read(D& res) {
  res = 0;
  register D g = 1;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') g = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    res = (res << 3) + (res << 1) + (ch ^ 48);
    ch = getchar();
  }
  res *= g;
}
const int INF = 1e9 + 7;
vector<int> t[101000];
struct E {
  int to, nt, w, v;
} e[202000];
int n, m, rot, L, R, M, sn, head[101000], tot, X, Y, W;
int siz[101000], vis[101000], dep[101000], mx[101000], val[101000], a[101000],
    pa[101000], b[101000], pb[101000], q[101000], hed, tal, N, maxi, root;
int A, B;
vector<int> son;
void add(int x, int y, int w) {
  e[++tot].to = y;
  e[tot].nt = head[x];
  head[x] = tot;
  e[tot].w = w;
}
void findroot(int x, int fa) {
  siz[x] = 1;
  mx[x] = 0;
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (e[k].to == fa || vis[e[k].to]) continue;
    findroot(e[k].to, x);
    siz[x] += siz[e[k].to];
    mx[x] = max(mx[x], siz[e[k].to]);
  }
  mx[x] = max(mx[x], N - siz[x]);
  if (mx[x] < maxi) maxi = mx[x], root = x;
}
void D_1(int x, int fa) {
  siz[x] = 1;
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (e[k].to == fa || vis[e[k].to]) continue;
    D_1(e[k].to, x);
    siz[x] += siz[e[k].to];
  }
}
void divided(int x, int fa) {
  if (fa) t[fa].emplace_back(x);
  vis[x] = 1;
  D_1(x, 0);
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (e[k].to == fa || vis[e[k].to]) continue;
    N = siz[e[k].to];
    maxi = INF;
    findroot(e[k].to, x);
    divided(root, x);
  }
}
void D_2(int x, int fa, int depth) {
  dep[x] = depth;
  mx[x] = depth;
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (e[k].to == fa || vis[e[k].to]) continue;
    val[e[k].to] = val[x] + e[k].v;
    D_2(e[k].to, x, depth + 1);
    mx[x] = max(mx[x], mx[e[k].to]);
  }
}
inline bool bbb(int x, int y) { return mx[x] < mx[y]; }
void D_3(int x, int fa) {
  if (val[x] > b[dep[x]]) b[dep[x]] = val[x], pb[dep[x]] = x;
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (e[k].to == fa || vis[e[k].to]) continue;
    D_3(e[k].to, x);
  }
}
void conquer(int x) {
  if (sn) return;
  son.clear();
  val[x] = 0;
  D_2(x, 0, 0);
  for (int k = head[x]; k != -1; k = e[k].nt) {
    if (vis[e[k].to]) continue;
    son.emplace_back(e[k].to);
  }
  sort(son.begin(), son.end(), bbb);
  for (int i = 0; i <= mx[x]; i++) a[i] = b[i] = -INF, pa[i] = pb[i] = 0;
  maxi = 0;
  a[0] = 0;
  pa[0] = x;
  for (auto d : son) {
    for (int i = 1; i <= mx[d]; i++) b[i] = -INF, pb[i] = 0;
    D_3(d, x);
    hed = 1;
    tal = 0;
    for (int i = min(R - 1, maxi); i >= L - 1; i--) {
      if (a[i] == -INF) continue;
      while (hed <= tal && a[q[tal]] <= a[i]) tal--;
      q[++tal] = i;
    }
    for (int i = 1; i <= mx[d]; i++) {
      while (hed <= tal && q[hed] + i > R) {
        hed++;
      }
      if (L - i <= maxi && L >= i && a[L - i] > -INF) {
        while (hed <= tal && a[q[tal]] <= a[L - i]) {
          tal--;
        }
        q[++tal] = L - i;
      }
      if (hed <= tal && b[i] + a[q[hed]] >= 0) {
        sn = 1, A = pa[q[hed]], B = pb[i];
      }
    }
    for (int i = 1; i <= mx[d]; i++) {
      if (a[i] < b[i]) a[i] = b[i], pa[i] = pb[i];
    }
    maxi = mx[d];
  }
  vis[x] = 1;
  for (auto d : t[x]) conquer(d);
}
int ck(int lim) {
  for (int i = 1; i <= n; i++)
    for (int k = head[i]; k != -1; k = e[k].nt) {
      if (e[k].w < lim)
        e[k].v = -1;
      else
        e[k].v = 1;
    }
  for (int i = 1; i <= n; i++) vis[i] = 0;
  sn = 0;
  conquer(rot);
  return sn;
}
void dichotomize(int l, int r) {
  if (l == r) {
    return ck(l), void();
  }
  int mid = (l + r + 1) >> 1;
  if (ck(mid))
    dichotomize(mid, r);
  else
    dichotomize(l, mid - 1);
}
int main() {
  read(n);
  read(L);
  read(R);
  memset(head, -1, sizeof(head));
  tot = -1;
  for (int i = 1; i <= n - 1; i++) {
    read(X);
    read(Y);
    read(W);
    add(X, Y, W);
    add(Y, X, W);
    M = max(M, W);
  }
  N = n;
  maxi = INF;
  findroot(1, 0);
  rot = root;
  divided(root, 0);
  dichotomize(0, M);
  printf("%d %d", A, B);
  return 0;
}