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, U, V, M, n, mm, uu, vv, head[100005], lk[100005 * 2],
    _next[100005 * 2], bg[100005], w[100005 * 2], q[100005], d[100005],
    fa[100005], e[100005], s[100005], f[100005], ff[100005], g[100005],
    gg[100005], h[100005];
bool b[100005];
void add(int u, int v, int x, int t) {
  lk[t] = v, w[t] = x, _next[t] = head[u], head[u] = t;
}
void init() {
  scanf("%d%d%d", &N, &L, &R);
  for (int i = 1, u, v; i < N; i++)
    scanf("%d%d%d", &u, &v, &bg[i]), add(u, v, bg[i], i),
        add(v, u, bg[i], i + N - 1);
}
int bfs(int p) {
  int l = 1, r = 1;
  for (q[1] = p, fa[p] = 0; l <= r; l++)
    for (int u = q[l], i = head[u], v; v = lk[i], i; i = _next[i])
      if (!b[v] && v != fa[u])
        fa[v] = u, q[++r] = v, d[v] = d[u] + 1,
        e[v] = e[u] + (w[i] < bg[M] ? -1 : 1);
  return r;
}
int find(int p) {
  int mi = 1e9, r = bfs(p), o;
  for (int x = r, u; u = q[x], x; x--) {
    int ma = 0;
    s[u] = 1;
    for (int i = head[u], v; v = lk[i], i; i = _next[i])
      if (!b[v] && v != fa[u]) s[u] += s[v], ma = max(ma, s[v]);
    ma = max(ma, r - s[u]);
    if (ma < mi) mi = ma, o = u;
  }
  return o;
}
bool work(int u) {
  int s = bfs(u), l = 1, r = 0;
  bool ok = 0;
  for (int i = 1; i <= s; i++)
    if (e[q[i]] > ff[d[q[i]]]) ff[d[q[i]]] = e[q[i]], gg[d[q[i]]] = q[i];
  for (int i = s, j = 0, ll, rr; ll = L - i, rr = R - i, !ok && i && ll <= n;
       i--) {
    for (; j < ll; j++)
      ;
    for (; j <= rr && j <= n; j++) {
      for (; l <= r && f[j] > f[h[r]]; r--)
        ;
      h[++r] = j;
    }
    for (; l <= r && h[l] < ll; l++)
      ;
    if (l <= r && f[h[l]] + ff[i] >= 0) U = g[h[l]], V = gg[i], ok = 1;
  }
  n = max(n, s);
  for (int i = 1; i <= s; i++) {
    if (ff[i] > f[i]) f[i] = ff[i], g[i] = gg[i];
    ff[i] = -1e9;
  }
  return ok;
}
bool check(int p) {
  int s;
  d[p] = e[p] = 0, s = bfs(p), n = 0, f[0] = 0, g[0] = p;
  for (int i = 1; i <= s; i++) f[i] = ff[i] = -1e9;
  for (int i = head[p], v; v = lk[i], i; i = _next[i])
    if (!b[v] && work(v)) return 1;
  return 0;
}
void dfs(int u) {
  int p = find(u), l = 1, r = N - 1;
  b[p] = 1;
  for (; l <= r;) {
    M = (l + r) / 2;
    if (check(p))
      l = M + 1;
    else
      r = M - 1;
  }
  M = r, check(p);
  if (M > mm) mm = M, uu = U, vv = V;
  for (int i = head[p], v; v = lk[i], i; i = _next[i])
    if (!b[v]) dfs(v);
}
void doit() {
  sort(bg + 1, bg + N), dfs(1);
  printf("%d %d\n", uu, vv);
}
int main() {
  init();
  doit();
  return 0;
}