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, m;
bool debug = false;
int k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
struct Road {
  int head[200005], next[200005], e[200005], tot = 0;
  void add(int u, int v) {
    e[++tot] = v;
    next[tot] = head[u];
    head[u] = tot;
  }
} A;
int L, R, c[200005], sz[200005], root, a[200005], v, V, g[200005], g0[200005],
    f[200005], f0[200005], S, T, q[200005];
bool ans;
void dfs(int x, int p) {
  sz[x] = 1;
  for (int i = A.head[x]; i; i = A.next[i])
    if (A.e[i] != p) {
      dfs(A.e[i], x);
      sz[x] += sz[A.e[i]];
    }
}
void divide(int &x) {
  sz[x] = 1;
  int y = 0;
  for (int i = A.head[x]; i; i = A.next[i]) {
    int to = A.e[i];
    sz[x] += sz[to];
    if (y == 0 || sz[to] > sz[y]) {
      y = to;
    }
  }
  if (sz[y] > sz[x] / 2) {
    sz[x] -= sz[y];
    x = y;
    divide(x);
  }
}
void find(int x, int p, int d, int val) {
  if (val > g[d]) {
    g[d] = val;
    g0[d] = x;
  }
  for (int i = A.head[x]; i; i = A.next[i])
    if (A.e[i] != p && sz[A.e[i]] > 0) {
      int to = A.e[i];
      find(to, x, d + 1, val + ((c[i] >= V) ? 1 : -1));
    }
}
void updata(int &preDis, int lim) {
  int j = 0, h = 1, t = 0;
  for (int dis = lim; dis && dis >= L - preDis; dis--)
    if (g[dis] > -lim) {
      while (j + dis <= R && j <= preDis) {
        while (h <= t && f[j] > f[q[t]]) t--;
        q[++t] = j++;
      }
      while (h <= t && q[h] + dis < L) h++;
      if (h <= t && g[dis] + f[q[h]] >= 0) {
        ans = 1;
        S = f0[q[h]];
        T = g0[dis];
        return;
      }
    }
  preDis = max(preDis, lim);
  for (int i = 1; i <= lim; i++)
    if (g[i] > f[i]) {
      f[i] = g[i];
      f0[i] = g0[i];
    }
}
void dd(int x) {
  if (ans) return;
  int len = 0, lim;
  divide(x);
  memset(f, 200, min(sz[x], R) * 4 + 4);
  f[0] = 0;
  sz[x] = 0;
  f0[0] = x;
  for (int i = A.head[x]; i; i = A.next[i]) {
    int to = A.e[i];
    if (!ans) {
      lim = min(R, sz[to]);
      memset(g, 200, lim * 4 + 4);
      if (lim > 0) {
        find(to, x, 1, (c[i] >= V) ? 1 : -1);
        updata(len, lim);
      }
    }
  }
  for (int i = A.head[x]; i; i = A.next[i])
    if (sz[A.e[i]]) dd(A.e[i]);
}
int main() {
  int l = 0, r = 0, mid;
  scanf("%d%d%d", &n, &L, &R);
  for (int i = 1, x, y, z; i < n; i++) {
    scanf("%d%d%d", &x, &y, &z);
    A.add(x, y);
    c[A.tot] = z;
    A.add(y, x);
    c[A.tot] = z;
    a[r++] = z;
  }
  sort(a, a + r);
  while (l + 1 < r) {
    mid = (l + r) / 2;
    V = a[mid];
    dfs(1, 0);
    ans = 0;
    dd(1);
    if (ans)
      l = mid;
    else
      r = mid;
  }
  V = a[l];
  dfs(1, 0);
  ans = 0;
  dd(1);
  printf("%d %d\n", S, T);
  return 0;
}