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 MAXN = 1001 * 101;
pair<int, int> seg[2 * MAXN];
int n, s, e;
bool mark[MAXN];
vector<pair<int, int> > adj[MAXN];
inline void update(int i, pair<int, int> x, bool f = 1) {
  if (seg[i + n] > x && f) return;
  for (seg[i += n] = x; i >>= 1;) seg[i] = max(seg[i << 1], seg[i << 1 | 1]);
}
inline pair<int, int> get(int l, int r) {
  pair<int, int> ans = {-1e9, 0};
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = max(ans, seg[l++]);
    if (r & 1) ans = max(ans, seg[--r]);
  }
  return ans;
}
struct TT {
  int first, second, T;
};
TT ans = {-1, 0, 0};
int sz[MAXN], ss, tt;
vector<int> v, v2;
vector<TT> v1;
void dfs(int u, int p) {
  sz[u] = 1;
  for (auto vv : adj[u])
    if (vv.first != p && !mark[vv.first])
      dfs(vv.first, u), sz[u] += sz[vv.first], v.push_back(vv.second);
}
int a[MAXN], d[MAXN];
void dfs2(int u, int p, int x) {
  for (auto v : adj[u]) {
    if (mark[v.first] || p == v.first) continue;
    d[v.first] = d[u] + 1;
    a[v.first] = a[u] + (v.second >= x);
    dfs2(v.first, u, x);
  }
  v1.push_back({2 * a[u] - d[u], d[u], u});
}
void solve(int x) {
  v.clear();
  dfs(x, 0);
  int n = sz[x], p = -1;
  if (sz[x] < s) return;
  while (1) {
    int f = 1, v;
    for (auto u : adj[x])
      if (!mark[u.first] && sz[u.first] > n / 2 && p != u.first)
        f = 0, v = u.first;
    if (f) break;
    p = x;
    x = v;
  }
  v.push_back(-1);
  sort(v.begin(), v.end());
  int l = 0, r = (int)v.size();
  while (r - l > 1) {
    int mid = (l + r) / 2;
    int k = v[mid];
    v2.clear();
    v2.push_back(0);
    update(0, {0, x});
    int f = 0;
    for (auto u : adj[x]) {
      if (mark[u.first]) continue;
      v1.clear();
      d[u.first] = 1;
      a[u.first] = (u.second >= k);
      dfs2(u.first, x, k);
      for (auto v : v1) {
        if (v.second > e) continue;
        pair<int, int> x = get(max(0, s - v.second), e - v.second + 1);
        if (x.first + v.first >= 0) f = 1;
        if (x.first + v.first >= 0 && ans.first < k) ans = {k, v.T, x.second};
      }
      for (auto u : v1) {
        update(u.second, {u.first, u.T});
        v2.push_back(u.second);
      }
    }
    if (f)
      l = mid;
    else
      r = mid;
    for (auto u : v2) update(u, {-1e9, 0}, 0);
  }
  mark[x] = 1;
  for (auto u : adj[x])
    if (!mark[u.first]) solve(u.first);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int x, y, z;
  cin >> n >> s >> e;
  for (int i = 1; i < n; i++) {
    cin >> x >> y >> z;
    adj[x].push_back({y, z});
    adj[y].push_back({x, z});
  }
  for (int u = 0; u < n; u++) update(u, {-1e9, 0}, 0);
  solve(1);
  cout << ans.second << ' ' << ans.T << '\n';
}