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 std::max;
using std::min;
using std::pair;
using std::sort;
using std::unique;
using std::vector;
const int maxn = 100010;
const int inf = 1000000001;
int n, L, R, m;
int tn, M, Lim;
int ans, ansx, ansy;
vector<pair<int, int> > A[maxn];
bool cut[maxn];
int b[maxn], size[maxn], dize[maxn], ret[maxn];
int x[maxn], y[maxn], xp[maxn], yp[maxn], q[maxn];
inline void dfs_c(const int &x, const int &p, const int &sr) {
  int t;
  size[x] = 1, dize[x] = 0;
  for (typeof((A[x]).begin()) it = (A[x]).begin(); it != (A[x]).end(); ++it)
    if (t = it->first, !cut[t] && p != t) {
      dfs_c(t, x, sr);
      size[x] += size[t], dize[x] = max(dize[x], size[t]);
    }
  dize[x] = max(dize[x], sr - size[x]), ret[x] = x;
  for (typeof((A[x]).begin()) it = (A[x]).begin(); it != (A[x]).end(); ++it)
    if (t = it->first, !cut[t] && p != t)
      if (dize[ret[t]] < dize[ret[x]]) ret[x] = ret[t];
}
inline void dfs(const int &x, const int &p, const int &dep, const int &len) {
  int t;
  M = max(dep, M), size[x] = 1;
  if (len > y[dep]) y[dep] = len, yp[dep] = x;
  for (typeof((A[x]).begin()) it = (A[x]).begin(); it != (A[x]).end(); ++it)
    if (t = it->first, !cut[t] && p != t) {
      dfs(t, x, dep + 1, len + ((it->second >= Lim) ? 1 : -1));
      size[x] += size[t];
    }
}
void dac(int rt, int sr) {
  dfs_c(rt, 0, sr), rt = ret[rt];
  int l, r, mid, tx, ty, _x, _y, ts, u, t, i, head, tail;
  for (l = max(ans - 1, 0), r = m - 1; l != r;) {
    mid = l + r + 1 >> 1, Lim = b[mid], tn = 0, ts = -inf;
    for (i = 0; i <= sr; ++i) x[i] = -inf;
    x[0] = 0, xp[0] = rt;
    for (typeof((A[rt]).begin()) it = (A[rt]).begin(); it != (A[rt]).end();
         ++it)
      if (u = it->first, !cut[u]) {
        M = 0;
        for (i = 0; i <= size[u]; ++i) y[i] = -inf;
        y[0] = 0, yp[0] = rt;
        dfs(u, rt, 1, it->second >= Lim ? 1 : -1);
        head = 1, tail = 0, t = 0;
        for (i = min(R, M); i >= 0 && L - i <= tn; --i) {
          while (t <= R - i && t <= tn) {
            while (head <= tail && x[q[tail]] <= x[t]) --tail;
            q[++tail] = t++;
          }
          while (head <= tail && q[head] < L - i) ++head;
          if (head <= tail && ts < y[i] + x[q[head]]) {
            ts = y[i] + x[q[head]], tx = xp[q[head]], ty = yp[i];
          }
          if (ts >= 0) break;
        }
        if (ts >= 0) break;
        for (tn = max(tn, M), i = 0; i <= tn; ++i)
          if (x[i] < y[i]) x[i] = y[i], xp[i] = yp[i];
      }
    if (ts >= 0)
      _x = tx, _y = ty, l = mid;
    else
      r = mid - 1;
  }
  if (l > ans) ans = l, ansx = _x, ansy = _y;
  cut[rt] = 1;
  for (typeof((A[rt]).begin()) it = (A[rt]).begin(); it != (A[rt]).end(); ++it)
    if (u = it->first, !cut[u])
      if (size[u] >= L) dac(u, size[u]);
  cut[rt] = 0;
}
int main() {
  int i, x, y, w;
  scanf("%d%d%d", &n, &L, &R);
  for (i = 1; i < n; ++i) {
    scanf("%d%d%d", &x, &y, &w);
    A[x].push_back(pair<int, int>(y, w)), A[y].push_back(pair<int, int>(x, w));
    b[i] = w;
  }
  b[0] = -1;
  sort(b, b + n);
  m = unique(b, b + n) - b;
  dac(1, n);
  printf("%d %d\n", ansx, ansy);
  return 0;
}