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>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 1e2;
void fin() {}
const bool flag = 0;
const int N = 1e5 + 10;
int sz[N];
bitset<N> cent;
vector<pii> adj[N];
void calc_sz(int first, int p = -1) {
  sz[first] = 1;
  for (pii& to : adj[first]) {
    if (to.first != p && !cent[to.first]) {
      calc_sz(to.first, first);
      sz[first] += sz[to.first];
    }
  }
}
int c_sz;
int fnd(int first, int p = -1) {
  for (pii& to : adj[first]) {
    if (to.first != p && !cent[to.first] && sz[to.first] * 2 >= c_sz) {
      return fnd(to.first, first);
    }
  }
  return first;
}
int a[N], t[N << 2], shift, n;
void upd(int first, int v) {
  first++;
  first += shift;
  if (v == -INF) {
    t[first] = -INF;
  } else {
    t[first] = max(t[first], v);
  }
  while (first >>= 1) {
    t[first] = max(t[first << 1], t[first << 1 | 1]);
  }
}
int get(int first, int second) {
  first++, second++;
  first += shift, second += shift;
  int mx = -INF;
  for (; first <= second; first >>= 1, second >>= 1) {
    if (first & 1) {
      mx = max(mx, t[first++]);
    }
    if (~second & 1) {
      mx = max(mx, t[second--]);
    }
  }
  return mx;
}
int l, r, cur_x, weight;
void dfsget(int first, int d = 1, int p = -1) {
  if (r < d || ~cur_x) {
    return;
  }
  if (-get(max(0, l - d), r - d) <= a[first]) {
    cur_x = first;
    return;
  }
  for (pii& to : adj[first]) {
    if (to.first != p && !cent[to.first]) {
      a[to.first] = a[first] + (to.second >= weight ? 1 : -1);
      dfsget(to.first, d + 1, first);
    }
  }
}
int mx;
void dfsadd(int first, int d = 1, int p = -1) {
  upd(d, a[first]);
  mx = max(mx, d);
  for (pii& to : adj[first]) {
    if (to.first != p && !cent[to.first]) {
      a[to.first] = a[first] + (to.second >= weight ? 1 : -1);
      dfsadd(to.first, d + 1, first);
    }
  }
}
void solve(int first = 0) {
  calc_sz(first);
  c_sz = sz[first];
  first = fnd(first);
  cent[first] = 1;
  a[first] = 0;
  upd(0, a[first]);
  mx = 0;
  for (pii& to : adj[first]) {
    if (!cent[to.first]) {
      a[to.first] = (to.second >= weight ? 1 : -1);
      dfsget(to.first);
      if (~cur_x) {
        break;
      }
      dfsadd(to.first);
    }
  }
  for (int i = 0; i <= mx; ++i) {
    upd(i, -INF);
  }
  if (~cur_x) {
    return;
  }
  for (pii& to : adj[first]) {
    if (!cent[to.first]) {
      solve(to.first);
    }
  }
}
int ans_y = -1;
void dfs(int first, int d = 0, int sum = 0, int p = -1) {
  if (~ans_y || d > r) {
    return;
  }
  if (~p && l <= d && sum >= 0) {
    ans_y = first;
    return;
  }
  for (pii& to : adj[first]) {
    if (to.first != p) {
      dfs(to.first, d + 1, sum + (to.second >= weight ? 1 : -1), first);
    }
  }
}
void ma1n() {
  cin >> n >> l >> r;
  for (shift = 1; shift < n; shift <<= 1)
    ;
  shift--;
  vector<int> ms;
  for (int i = 1; i < n; ++i) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    adj[u].push_back({v, w});
    adj[v].push_back({u, w});
    ms.push_back(w);
  }
  sort((ms).begin(), (ms).end());
  ms.erase(unique((ms).begin(), (ms).end()), ms.end());
  int l = 0;
  int r = (int)ms.size() - 1;
  int ans = -1, ans_x = -1;
  fill(t, t + (n << 2), -INF);
  while (l <= r) {
    int m = l + r >> 1;
    cent.reset();
    cur_x = -1, weight = ms[m];
    solve();
    if (~cur_x) {
      ans = ms[m], ans_x = cur_x, l = m + 1;
    } else {
      r = m - 1;
    }
  }
  weight = ans;
  dfs(ans_x);
  cout << ans_x + 1 << " " << ans_y + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr), fin();
  int ts = 1;
  if (flag) {
    cin >> ts;
  }
  while (ts--) {
    ma1n();
  }
  return 0;
}