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;
int n, L, R, ans = -1;
int totm = 1, now[100000 + 10];
struct Edge {
  int k, f, next;
} e[100000 + 10 << 1];
int cq, size, sum, tot, lim;
int s[100000 + 10];
bool used[100000 + 10];
pair<int, int> p[100000 + 10], f[100000 + 10], g[100000 + 10], tmp, res;
int dl[100000 + 10];
void getsum(int i, int fa) {
  ++sum;
  for (int j = now[i]; j; j = e[j].next)
    if (!used[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 (!used[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 (!used[e[j].k] && e[j].k != fa)
      dfs(e[j].k, i, d + 1, s + (e[j].f >= lim ? 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 = -1000000001;
    dfs(e[p[i].second].k, 0, 1, (e[p[i].second].f >= lim ? 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) {
        tmp = make_pair(g[j].second, f[dl[l]].second);
        return 1;
      }
    }
    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 0;
}
void work(int i) {
  sum = 0;
  getsum(i, 0);
  size = 1000000001;
  getcq(i, 0);
  used[cq] = 1;
  tot = 0;
  for (i = now[cq]; i; i = e[i].next)
    if (!used[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 = 1000000001;
  while (l < r) {
    lim = (l + r) >> 1;
    if (check())
      l = lim + 1;
    else
      r = lim;
  }
  if (ans < l - 1) {
    ans = lim = l - 1;
    check();
    res = tmp;
  }
  for (i = now[cq]; i; i = e[i].next)
    if (!used[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);
    ++totm;
    e[totm].k = v;
    e[totm].f = w;
    e[totm].next = now[u];
    now[u] = totm;
    ++totm;
    e[totm].k = u;
    e[totm].f = w;
    e[totm].next = now[v];
    now[v] = totm;
  }
  work(1);
  printf("%d %d\n", res.first, res.second);
  return 0;
}