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 N = 100005;
const int inf = 1000000009;
int rd() {
  char c = getchar();
  int t = 0, f = 1;
  while (!isdigit(c)) f = (c == '-') ? -1 : 1, c = getchar();
  while (isdigit(c)) t = t * 10 + c - 48, c = getchar();
  return t * f;
}
void wt(int x) {
  if (x < 0) {
    putchar('-');
    wt(-x);
    return;
  }
  if (x > 9) wt(x / 10);
  putchar(x % 10 + 48);
  return;
}
vector<pair<int, int> > e[N];
long long dis[N];
pair<int, int> stk[N], g[N];
map<pair<int, int>, int> Map;
int head[N], cnt, sz[N], f[N], vis[N], Max, stkdep, Maxdep;
int top, l, r, Q[N], lim, sum, rt, n, Hash[N], x, y, Ans, Len, keynode, p1, p2;
struct Edge {
  int to, nxt, val;
} E[N << 1];
void Link(int u, int v, int w) {
  E[++cnt] = (Edge){v, head[u], w};
  head[u] = cnt;
  E[++cnt] = (Edge){u, head[v], w};
  head[v] = cnt;
}
void getrt(int x, int fa) {
  sz[x] = 1, f[x] = 0;
  for (int y, i = head[x]; i; i = E[i].nxt)
    if ((y = E[i].to) != fa && !vis[y]) {
      getrt(y, x);
      sz[x] += sz[y];
      f[x] = max(f[x], sz[y]);
    }
  f[x] = max(f[x], sum - sz[x]);
  if (f[x] < f[rt]) rt = x;
  return;
}
void getdis(int x, int fa, int dep, int val) {
  if (dep > r) return;
  stkdep = max(stkdep, dep);
  stk[dep] = max(stk[dep], make_pair(val, x));
  for (int y, i = head[x]; i; i = E[i].nxt)
    if ((y = E[i].to) != fa && !vis[y])
      getdis(y, x, dep + 1, val + (E[i].val >= lim ? 1 : -1));
}
void tour(int x, int fa, int dep, int val) {
  if (dep > r) return;
  Maxdep = max(Maxdep, dep);
  g[dep] = max(g[dep], make_pair(val, x));
  for (int y, i = head[x]; i; i = E[i].nxt)
    if ((y = E[i].to) != fa && !vis[y])
      tour(y, x, dep + 1, val + (E[i].val >= lim ? 1 : -1));
}
bool calc() {
  int L = max(l - stkdep, 0), R = min(r - stkdep, Maxdep), h = 1, t = 0;
  for (int i = ((int)L); i <= ((int)R); i++)
    if (i <= Maxdep) {
      while (h <= t && g[Q[t]] < g[i]) t--;
      Q[++t] = i;
    }
  if (!t) return 0;
  for (int i = ((int)stkdep); i >= ((int)1); i--) {
    if (stk[i].first + g[Q[h]].first >= 0) {
      Len = i + Q[h];
      p1 = stk[i].second;
      p2 = g[Q[h]].second;
      return 1;
    }
    if (L == Maxdep) return 0;
    if (Q[h] == L && l - i >= 0) h++;
    if (l - i >= 0) L++;
    if (R < Maxdep) {
      R++;
      while (h <= t && g[Q[t]] < g[R]) t--;
      Q[++t] = R;
    }
  }
  return 0;
}
bool solve(int x) {
  vis[x] = 1;
  Maxdep = 0;
  g[0] = make_pair(0, x);
  for (int y, i = head[x]; i; i = E[i].nxt)
    if (!vis[y = E[i].to]) {
      stkdep = 0;
      getdis(y, x, 1, E[i].val >= lim ? 1 : -1);
      if (calc()) {
        keynode = x;
        return 1;
      }
      for (int j = ((int)0); j <= ((int)stkdep); j++)
        stk[j] = make_pair(-inf, -inf);
      tour(y, x, 1, E[i].val >= lim ? 1 : -1);
    }
  for (int i = ((int)1); i <= ((int)Maxdep); i++) g[i] = make_pair(-inf, -inf);
  for (int y, i = head[x]; i; i = E[i].nxt)
    if (!vis[y = E[i].to]) {
      sum = sz[y], rt = 0;
      getrt(y, x);
      if (solve(rt)) return 1;
    }
  return 0;
}
bool chk(int x) {
  for (int i = ((int)0); i <= ((int)n); i++)
    vis[i] = 0, stk[i] = g[i] = make_pair(-inf, -inf);
  sum = n, rt = 0;
  lim = x;
  getrt(1, -1);
  return solve(rt);
}
int main() {
  n = rd(), l = rd(), r = rd();
  f[0] = inf;
  for (int i = ((int)1); i <= ((int)n - 1); i++) {
    x = rd(), y = rd(), Link(x, y, Hash[i] = rd());
    Map[make_pair(x, y)] = Hash[i], Map[make_pair(y, x)] = Hash[i];
  }
  sort(Hash + 1, Hash + n);
  for (int L = 1, R = n - 1; L <= R;) {
    int mid = L + R >> 1;
    if (chk(Hash[mid]))
      L = (Ans = mid) + 1;
    else
      R = mid - 1;
  }
  Ans = Hash[Ans];
  printf("%d %d\n", p1, p2);
  return 0;
}