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, le, ri, hed[100010], cnt, mx[100010], sz[100010], rt, vis[100010], ans;
int ji1 = 1, ji2 = 1, num, shu, f[100010], g[100010];
int premax, ggg, gggg[100010], maxdep, dep[100010], mxdep[100010];
struct node {
  int to, next, dis;
} a[200010];
struct qwq {
  int len, dis, ji;
} b[200010], e[2000010];
struct edge {
  int x, y, z;
} QAQ[200010];
struct ymh {
  int x, dis;
} c[100010];
inline int read() {
  int x = 0;
  char s = getchar();
  while (s > '9' || s < '0') s = getchar();
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x;
}
inline void add(int from, int to, int dis) {
  a[++cnt].to = to;
  a[cnt].dis = dis;
  a[cnt].next = hed[from];
  hed[from] = cnt;
}
inline void getrt(int x, int f, int size) {
  sz[x] = 1;
  mx[x] = 0;
  for (int i = hed[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (vis[y] || y == f) continue;
    getrt(y, x, size);
    sz[x] += sz[y];
    mx[x] = max(mx[x], sz[y]);
  }
  mx[x] = max(mx[x], size - sz[x]);
  if (mx[x] < mx[rt]) rt = x;
}
inline void dfs(int x, int f) {
  mxdep[x] = dep[x];
  for (int i = hed[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (y == f || vis[y]) continue;
    dep[y] = dep[x] + 1;
    dfs(y, x);
    mxdep[x] = max(mxdep[x], mxdep[y]);
  }
}
inline int cmp(ymh x, ymh y) { return mxdep[x.x] < mxdep[y.x]; }
inline void dfs2(int x, int f, int dis, int len, int mid) {
  maxdep = max(maxdep, len);
  b[++num].len = len;
  b[num].dis = dis;
  b[num].ji = x;
  for (int i = hed[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (y == f || vis[y]) continue;
    if (a[i].dis >= mid)
      dfs2(y, x, dis + 2, len + 1, mid);
    else
      dfs2(y, x, dis, len + 1, mid);
  }
}
inline int cmp1(qwq x, qwq y) { return x.len < y.len; }
inline int check(int x, int mid) {
  e[0].ji = x;
  int pd = 0;
  premax = 0;
  for (int i = 1; i <= shu; ++i) {
    num = 0;
    int y = c[i].x;
    maxdep = 0;
    if (c[i].dis >= mid)
      dfs2(y, x, 2, 1, mid);
    else
      dfs2(y, x, 0, 1, mid);
    sort(b + 1, b + num + 1, cmp1);
    deque<int> q;
    int cur = premax;
    for (int j = 1; j <= num; ++j) {
      while (b[j].len + e[cur].len >= le && cur >= 0) {
        while (!q.empty()) {
          if (e[q.back()].dis - e[q.back()].len < e[cur].dis - e[cur].len)
            q.pop_back();
          else
            break;
        }
        q.push_back(cur);
        --cur;
      }
      while (!q.empty()) {
        if (e[q.front()].len + b[j].len > ri) {
          q.pop_front();
        } else
          break;
      }
      if (!q.empty()) {
        if (e[q.front()].dis - e[q.front()].len + b[j].dis - b[j].len >= 0) {
          ji1 = e[q.front()].ji;
          ji2 = b[j].ji;
          pd = 1;
          break;
        }
      }
    }
    if (pd == 1) break;
    for (int j = 1; j <= num; ++j) {
      if (b[j].dis - b[j].len > e[b[j].len].dis - e[b[j].len].len ||
          e[b[j].len].len == 0)
        e[b[j].len] = b[j];
    }
    premax = maxdep;
  }
  for (int i = 0; i <= premax; ++i) {
    e[i].dis = 0;
    e[i].len = 0;
    e[i].ji = 0;
  }
  return pd;
}
inline void solve(int x, int size) {
  vis[x] = 1;
  shu = 0;
  for (int i = hed[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (vis[y]) continue;
    dep[y] = 1;
    dfs(y, 0);
    c[++shu].x = y;
    c[shu].dis = a[i].dis;
  }
  sort(c + 1, c + shu + 1, cmp);
  int l = ans + 1, r = n, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(x, mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  for (int i = hed[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (vis[y]) continue;
    int gg = sz[y];
    if (sz[y] > sz[x]) gg = size - sz[x];
    rt = 0;
    getrt(y, 0, gg);
    solve(rt, gg);
  }
}
int main() {
  n = read();
  le = read();
  ri = read();
  for (int i = 1; i <= n - 1; ++i) {
    QAQ[i].x = read();
    QAQ[i].y = read();
    QAQ[i].z = read();
    gggg[i] = QAQ[i].z;
  }
  sort(gggg + 1, gggg + n);
  ggg = unique(gggg + 1, gggg + n) - gggg - 1;
  for (int i = 1; i <= n - 1; ++i)
    QAQ[i].z = lower_bound(gggg + 1, gggg + ggg + 1, QAQ[i].z) - gggg;
  for (int i = 1; i <= n - 1; ++i) {
    int x = QAQ[i].x, y = QAQ[i].y, z = QAQ[i].z;
    add(x, y, z);
    add(y, x, z);
  }
  e[0].len = 0;
  e[0].dis = 0;
  mx[0] = 2e9;
  getrt(1, 0, n);
  solve(rt, n);
  printf("%d %d\n", ji1, ji2);
  return 0;
}