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 N = 1e5 + 7;
int lazy[N], len[N], pos[N], son[N], sonval[N], id[N], cnt, n, L, R;
pair<int, int> f[N << 2];
vector<pair<int, int> > p[N];
void getlen(int x, int fa) {
  len[x] = 1;
  son[x] = -1;
  for (auto v : p[x])
    if (v.first != fa) {
      getlen(v.first, x);
      len[x] = max(len[v.first] + 1, len[x]);
      if (son[x] == -1 || len[v.first] > len[son[x]])
        son[x] = v.first, sonval[x] = v.second;
    }
}
void getpos(int x, int fa) {
  pos[x] = ++cnt;
  id[cnt] = x;
  if (son[x] != -1) getpos(son[x], x);
  for (auto v : p[x])
    if (v.first != fa && v.first != son[x]) getpos(v.first, x);
}
void update(int x, int l, int r, int index, pair<int, int> y) {
  if (index < l || index > r) return;
  if (l == r) {
    f[x] = max(f[x], y);
    return;
  }
  int mid = (l + r) / 2;
  update(x << 1, l, mid, index, y);
  update(x << 1 | 1, mid + 1, r, index, y);
  f[x] = max(f[x << 1], f[x << 1 | 1]);
}
pair<int, int> query(int x, int l, int r, int left, int right) {
  if (left > r || right < l) return {-1e9, 0};
  if (left <= l && right >= r) return f[x];
  int mid = (l + r) / 2;
  return max(query(x << 1, l, mid, left, right),
             query(x << 1 | 1, mid + 1, r, left, right));
}
int mx = -1e9, val, S = -1, T = -1;
void dfs(int x, int fa, int y, int val) {
  if (son[x] == -1) {
    lazy[x] = 0;
    update(1, 1, n, pos[x], {y, pos[x]});
    return;
  }
  dfs(son[x], x, sonval[x] >= val ? 1 : -1, val);
  lazy[x] = lazy[son[x]];
  for (auto v : p[x])
    if (v.first != fa && v.first != son[x]) {
      dfs(v.first, x, v.second >= val ? 1 : -1, val);
      for (int i = 0; i < len[v.first]; i++) {
        int l = L - (i + 1), r = R - (i + 1);
        l = max(l, 1), r = min(r, len[x] - 1);
        pair<int, int> x1 = query(1, 1, n, pos[v.first] + i, pos[v.first] + i);
        pair<int, int> x2 = query(1, 1, n, pos[x] + l, pos[x] + r);
        if (x1.first == -1e9 || x2.first == -1e9) continue;
        if (x1.first + x2.first + lazy[x] + lazy[v.first] > mx) {
          mx = x1.first + x2.first + lazy[x] + lazy[v.first];
          S = id[x1.second];
          T = id[x2.second];
        }
      }
      for (int i = 0; i < len[v.first]; i++) {
        pair<int, int> t = query(1, 1, n, pos[v.first] + i, pos[v.first] + i);
        t.first += lazy[v.first] - lazy[x];
        update(1, 1, n, pos[x] + i + 1, t);
      }
    }
  int l = max(L, 1), r = min(R, len[x] - 1);
  pair<int, int> t = query(1, 1, n, pos[x] + l, pos[x] + r);
  if (t.first > -1e9 && t.first + lazy[x] > mx) {
    mx = t.first + lazy[x];
    S = x;
    T = id[t.second];
  }
  update(1, 1, n, pos[x], {-lazy[x], pos[x]});
  lazy[x] += y;
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  int u, v, w, maxw = 0;
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    p[u].push_back({v, w});
    p[v].push_back({u, w});
    maxw = max(maxw, w);
  }
  getlen(1, 0);
  cnt = 0;
  getpos(1, 0);
  int l = 0, r = maxw, ans = 0, s, t;
  while (l <= r) {
    int mid = (l + r) / 2;
    for (int i = 0; i < N << 2; i++) f[i] = {-1e9, 0};
    mx = -1e9;
    dfs(1, 0, 0, mid);
    if (mx >= 0)
      ans = mid, s = S, t = T, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d %d", s, t);
  return 0;
}