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, INF = 0x3f3f3f3f;
int n, L, R, xx, yy, zz, ll, rr, mid, ct, totl, last[MAXN], pre[2 * MAXN],
    oth[2 * MAXN], len[2 * MAXN], val[2 * MAXN], dis[MAXN], de[MAXN],
    size[MAXN], z[MAXN], mxd[MAXN], q[MAXN], a[MAXN], b[MAXN];
bool vis[MAXN];
pair<int, int> ret_pair, ans;
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < '0') c = getchar();
  while (c >= '0') x = x * 10 + c - '0', c = getchar();
  return x;
}
inline void conn(int a, int b, int c) {
  pre[++totl] = last[a];
  last[a] = totl;
  oth[totl] = b;
  len[totl] = c;
}
void getct(int x, int fx, int t_size) {
  size[x] = 1;
  int mx = 0;
  for (int p = last[x]; p; p = pre[p]) {
    int r = oth[p];
    if (r != fx && !vis[r]) {
      getct(r, x, t_size);
      size[x] += size[r];
      mx = max(mx, size[r]);
    }
  }
  mx = max(mx, t_size - size[x]);
  if (2 * mx <= t_size) ct = x;
}
void getde(int x, int fx) {
  mxd[x] = 0;
  for (int p = last[x]; p; p = pre[p]) {
    int r = oth[p];
    if (!vis[r] && r != fx) {
      de[r] = de[x] + 1;
      getde(r, x);
      mxd[x] = max(mxd[x], mxd[r] + 1);
    }
  }
}
void dfs(int x, int fx) {
  size[x] = 1;
  if (dis[x] > dis[b[de[x]]]) b[de[x]] = x;
  for (int p = last[x]; p; p = pre[p]) {
    int r = oth[p];
    if (!vis[r] && r != fx) {
      dis[r] = dis[x] + val[p];
      dfs(r, x);
      size[x] += size[r];
    }
  }
}
inline bool cmp(int x, int y) { return mxd[x] < mxd[y]; }
bool calc(int x) {
  de[x] = 0;
  getde(x, 0);
  z[0] = 0;
  for (int p = last[x]; p; p = pre[p])
    if (!vis[oth[p]]) {
      z[++z[0]] = oth[p];
      dis[oth[p]] = val[p];
    }
  sort(z + 1, z + z[0] + 1, cmp);
  for (int i = 0; i <= mxd[x]; ++i) a[i] = 0;
  dis[x] = 0;
  a[0] = x;
  for (int i = 1; i <= z[0]; ++i) {
    int r = z[i];
    mxd[r]++;
    for (int i = 0; i <= mxd[r]; ++i) b[i] = 0;
    dfs(r, x);
    int he = 1, ta = 0;
    for (int i = min(mxd[r], R); i >= L + 1; --i)
      if (a[i]) {
        while (he <= ta && dis[a[i]] > dis[q[ta]]) ta--;
        q[++ta] = a[i];
      }
    for (int i = 0; i <= mxd[r]; ++i) {
      if (i > R) break;
      while (he <= ta && de[q[he]] > R - i) he++;
      if (L - i >= 0 && L - i <= mxd[x] && a[L - i]) {
        while (he <= ta && dis[a[L - i]] > dis[q[ta]]) ta--;
        q[++ta] = a[L - i];
      }
      if (b[i] && he <= ta && dis[b[i]] + dis[q[he]] >= 0) {
        ret_pair = make_pair(q[he], b[i]);
        return 1;
      }
    }
    for (int i = 0; i <= mxd[r]; ++i)
      if (dis[b[i]] > dis[a[i]]) a[i] = b[i];
  }
  return 0;
}
bool work(int x, int t_size) {
  getct(x, 0, t_size);
  int rt = ct;
  vis[rt] = 1;
  if (calc(rt)) return 1;
  for (int p = last[rt]; p; p = pre[p]) {
    int r = oth[p];
    if (!vis[r]) {
      if (work(r, size[r])) return 1;
    }
  }
  return 0;
}
bool check(int mid) {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= totl; ++i) val[i] = (len[i] < mid ? -1 : 1);
  return work(1, n);
}
int main() {
  n = read();
  L = read();
  R = read();
  for (int i = 1; i <= n - 1; ++i) {
    xx = read();
    yy = read();
    zz = read();
    rr = max(rr, zz);
    conn(xx, yy, zz);
    conn(yy, xx, zz);
  }
  dis[0] = -INF;
  while (ll <= rr) {
    mid = (ll + rr) >> 1;
    if (check(mid)) {
      ans = ret_pair, ll = mid + 1;
    } else
      rr = mid - 1;
  }
  printf("%d %d\n", ans.first, ans.second);
  return 0;
}