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 MAXN = 100005;
struct EDGE {
  int num, next, w;
} e[MAXN * 2];
int en = 0, start[MAXN];
inline void Add_edge(int p, int q, int r) {
  en++;
  e[en].num = q;
  e[en].next = start[p];
  start[p] = en;
  e[en].w = r;
  en++;
  e[en].num = p;
  e[en].next = start[q];
  start[q] = en;
  e[en].w = r;
}
int n, L, R;
int ans = -1, ans_start, ans_end;
int stk[MAXN], top = 0;
bool u[MAXN];
int size[MAXN], maxch[MAXN];
void Clr() {
  for (int i = 1; i <= top; i++) u[stk[i]] = false;
  top = 0;
}
void dfs(int p) {
  u[p] = true;
  stk[++top] = p;
  size[p] = 1;
  maxch[p] = 0;
  for (int i = start[p]; i != 0; i = e[i].next)
    if (!u[e[i].num]) {
      dfs(e[i].num);
      size[p] += size[e[i].num];
      maxch[p] = max(maxch[p], size[e[i].num]);
    }
}
int dis[MAXN], v[MAXN], a[MAXN], b[MAXN];
int pa[MAXN], pb[MAXN];
void dfs2(int p, int fa, int mid, int *a, int *pa) {
  for (int i = start[p]; i != 0; i = e[i].next)
    if (e[i].num != fa) {
      dis[e[i].num] = dis[p] + 1;
      v[e[i].num] = v[p];
      if (e[i].w >= mid)
        v[e[i].num]++;
      else
        v[e[i].num]--;
      dfs2(e[i].num, p, mid, a, pa);
    }
  if (v[p] > a[dis[p]]) a[dis[p]] = v[p], pa[dis[p]] = p;
}
int q[MAXN];
bool chk(int mid, int p) {
  int s = (top - 1) / 2;
  int nt, last, st = start[p];
  for (int i = start[p]; i != 0; i = e[i].next) {
    s -= size[e[i].num];
    if (s <= 0) {
      nt = e[i].next;
      last = i;
      e[i].next = 0;
      break;
    }
  }
  for (int i = 0; i <= top; i++) a[i] = b[i] = -1000000;
  dis[p] = 0;
  v[p] = 0;
  dfs2(p, -1, mid, b, pb);
  start[p] = nt;
  e[last].next = nt;
  dfs2(p, -1, mid, a, pa);
  start[p] = st;
  int l = 1, r = 0;
  int now1 = -1;
  for (int i = top; i >= 0; i--) {
    while (now1 != top && now1 + 1 + i <= R) {
      q[++r] = ++now1;
      while (l < r && a[q[r]] >= a[q[r - 1]]) r--, q[r] = q[r + 1];
    }
    while (l <= r && q[l] + i < L) l++;
    if (l <= r && a[q[l]] + b[i] >= 0) {
      if (mid > ans) {
        ans = mid;
        ans_start = pa[q[l]];
        ans_end = pb[i];
      }
      return true;
    }
  }
  return false;
}
void work(int p) {
  Clr();
  dfs(p);
  if (top == 1) return;
  if (top == 2) {
    if (L == 1 && e[start[p]].w > ans) {
      ans = e[start[p]].w;
      ans_start = p;
      ans_end = e[start[p]].num;
    }
    return;
  }
  for (int i = 1; i <= top; i++)
    maxch[stk[i]] = max(maxch[stk[i]], top - size[stk[i]]);
  int k = p;
  for (int i = 1; i <= top; i++)
    if (maxch[stk[i]] < maxch[k]) k = stk[i];
  p = k;
  Clr();
  dfs(p);
  int l = -1, r = 1000000000;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (chk(mid, p))
      l = mid;
    else
      r = mid - 1;
    if (r < ans) break;
  }
  int s = (top - 1) / 2;
  int nt, last, st = start[p];
  for (int i = start[p]; i != 0; i = e[i].next) {
    s -= size[e[i].num];
    if (s <= 0) {
      nt = e[i].next;
      last = i;
      e[i].next = 0;
      break;
    }
  }
  work(p);
  start[p] = nt;
  e[last].next = nt;
  work(p);
  start[p] = st;
}
int main() {
  scanf("%d", &n);
  scanf("%d%d", &L, &R);
  for (int i = 1; i < n; i++) {
    int p, q, r;
    scanf("%d%d%d", &p, &q, &r);
    Add_edge(p, q, r);
  }
  work(1);
  printf("%d %d\n", ans_start, ans_end);
  return 0;
}