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 = 100005;
struct Edge {
  int v, w;
};
vector<Edge> v[N];
int n, lv, rv, num[N], m, sz[N], rtsz, rt, tot, ans = -1, ans1, ans2;
bool vis[N];
void getrt(int pos, int fa) {
  sz[pos] = 1;
  int mx = 0;
  for (auto &i : v[pos]) {
    if (i.v == fa || vis[i.v]) continue;
    getrt(i.v, pos);
    sz[pos] += sz[i.v];
    mx = max(mx, sz[i.v]);
  }
  mx = max(mx, tot - sz[pos]);
  if (mx < rtsz) rtsz = mx, rt = pos;
}
int tmp[N], tpos[N], mx, seq[N], spos[N], idx, top;
Edge stk[N];
void dfs(int pos, int fa, int dep, int sum, int mid) {
  if (tmp[dep] < sum) tmp[dep] = sum, tpos[dep] = pos;
  mx = max(mx, dep);
  for (auto &i : v[pos]) {
    if (i.v == fa || vis[i.v]) continue;
    dfs(i.v, pos, dep + 1, sum + (i.w >= mid ? 1 : -1), mid);
  }
}
int cur1, cur2;
bool calc(int pos, int mid) {
  static int q[N];
  seq[idx = 0] = 0;
  spos[idx] = pos;
  for (int i = 1; i <= top; i++) {
    int v = stk[i].v;
    for (int j = 1; j <= sz[v]; j++) tmp[j] = INT_MIN / 2;
    mx = 0;
    dfs(v, pos, 1, stk[i].w >= mid ? 1 : -1, mid);
    int l = 1, r = 0, lb = idx, rb = idx + 1;
    for (int j = 1; j <= mx; j++) {
      while (rb > 0 && rb > lv - j) {
        --rb;
        while (l <= r && seq[q[r]] < seq[rb]) --r;
        q[++r] = rb;
      }
      while (lb >= 0 && lb > rv - j) {
        --lb;
        while (l <= r && q[l] > lb) ++l;
      }
      if (l <= r && seq[q[l]] + tmp[j] >= 0) {
        cur1 = spos[q[l]], cur2 = tpos[j];
        return 1;
      }
    }
    while (idx < mx) seq[++idx] = INT_MIN / 2;
    for (int j = 1; j <= mx; j++)
      if (seq[j] < tmp[j]) seq[j] = tmp[j], spos[j] = tpos[j];
  }
  return 0;
}
void solve(int pos) {
  int tt = tot;
  top = 0;
  for (auto &i : v[pos]) {
    if (vis[i.v]) continue;
    stk[++top] = i;
    sz[i.v] = sz[i.v] > sz[pos] ? tt - sz[pos] : sz[i.v];
  }
  sort(stk + 1, stk + top + 1,
       [](Edge a, Edge b) { return sz[a.v] < sz[b.v]; });
  int l = 1, r = m, t = 0, t1 = 0, t2 = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (calc(pos, num[mid]))
      t = mid, t1 = cur1, t2 = cur2, l = mid + 1;
    else
      r = mid - 1;
  }
  if (num[t] > ans) ans = num[t], ans1 = t1, ans2 = t2;
  vis[pos] = 1;
  for (auto &i : v[pos]) {
    if (vis[i.v]) continue;
    rtsz = tot = sz[i.v];
    getrt(i.v, 0);
    solve(rt);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> lv >> rv;
  for (int i = 1; i < n; i++) {
    int t1, t2, t3;
    cin >> t1 >> t2 >> t3;
    num[i] = t3;
    v[t1].push_back({t2, t3});
    v[t2].push_back({t1, t3});
  }
  sort(num + 1, num + n);
  m = unique(num + 1, num + n) - num - 1;
  rtsz = tot = n;
  getrt(1, 0);
  solve(rt);
  cout << ans1 << ' ' << ans2 << endl;
  return 0;
}