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 = 1000000001, nn = 100010;
struct edge {
  int k, f, next;
} e[nn << 1];
int cq, size, sum, tot, limited;
int n, L, R, ans = -1;
int m = 1, now[nn];
int s[nn];
bool beused[nn];
pair<int, int> p[nn], f[nn], g[nn], tempe, res;
int dl[nn];
void getsum(int i, int fa) {
  ++sum;
  for (int j = now[i]; j; j = e[j].next)
    if (!beused[e[j].k] && e[j].k != fa) getsum(e[j].k, i);
}
void getcq(int i, int fa) {
  int t = 0;
  s[i] = 1;
  for (int j = now[i]; j; j = e[j].next)
    if (!beused[e[j].k] && e[j].k != fa) {
      getcq(e[j].k, i);
      s[i] += s[e[j].k];
      t = max(t, s[e[j].k]);
    }
  t = max(t, sum - s[i]);
  if (t < size) {
    size = t;
    cq = i;
  }
}
void dfs(int i, int fa, int d, int s) {
  g[d] = max(g[d], make_pair(s, i));
  for (int j = now[i]; j; j = e[j].next)
    if (!beused[e[j].k] && e[j].k != fa)
      dfs(e[j].k, i, d + 1, s + (e[j].f >= limited ? 1 : -1));
}
bool check() {
  int i, j, k, l, r;
  f[0].second = cq;
  for (i = 1; i <= tot; ++i) {
    for (j = 1; j <= p[i].first; ++j) g[j].first = -oo;
    dfs(e[p[i].second].k, 0, 1, (e[p[i].second].f >= limited ? 1 : -1));
    l = 1, r = 0;
    for (j = 1, k = min(p[i - 1].first, R); j <= min(p[i].first, R); ++j) {
      while (k >= max(L - j, 0)) {
        while (l <= r && f[dl[r]] <= f[k]) --r;
        dl[++r] = k--;
      }
      while (l <= r && j + dl[l] > R) ++l;
      if (l <= r && g[j].first + f[dl[l]].first >= 0) {
        tempe = make_pair(g[j].second, f[dl[l]].second);
        return true;
      }
    }
    for (j = 1; j <= p[i - 1].first; ++j) f[j] = max(f[j], g[j]);
    for (; j <= p[i].first; ++j) f[j] = g[j];
  }
  return false;
}
void work(int i) {
  sum = 0;
  getsum(i, 0);
  size = oo;
  getcq(i, 0);
  beused[cq] = 1;
  tot = 0;
  for (i = now[cq]; i; i = e[i].next)
    if (!beused[e[i].k])
      p[++tot] = make_pair(s[e[i].k] < s[cq] ? s[e[i].k] : sum - s[cq], i);
  sort(p + 1, p + tot + 1);
  int l = 0, r = oo;
  while (l < r) {
    limited = (l + r) >> 1;
    if (check())
      l = limited + 1;
    else
      r = limited;
  }
  if (ans < l - 1) {
    ans = limited = l - 1;
    check();
    res = tempe;
  }
  for (i = now[cq]; i; i = e[i].next)
    if (!beused[e[i].k]) work(e[i].k);
}
int main() {
  int i, u, v, w;
  scanf("%d%d%d", &n, &L, &R);
  for (i = 1; i < n; ++i) {
    scanf("%d%d%d", &u, &v, &w);
    ++m;
    e[m].k = v;
    e[m].f = w;
    e[m].next = now[u];
    now[u] = m;
    ++m;
    e[m].k = u;
    e[m].f = w;
    e[m].next = now[v];
    now[v] = m;
  }
  work(1);
  printf("%d %d\n", res.first, res.second);
}