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 + 10, inf = 1e9 + 1;
int n, l, r, sm, mx_down[N], down[N], frs, lst, e[N], med, cnt = 0;
pair<int, int> seg[4 * N], centroid[N];
vector<pair<int, int> > g[N];
vector<int> vec;
bool mark[N];
vector<pair<pair<int, int>, int> > a;
inline void clean(int s = 0, int e = r + 1, int ind = 1) {
  if (seg[ind].first == -inf) return;
  seg[ind] = {-inf, -1};
  if (e - s < 2) return;
  int mid = (s + e) / 2;
  if (seg[2 * ind].first != -inf) clean(s, mid, 2 * ind);
  if (seg[2 * ind + 1].first != -inf) clean(mid, e, 2 * ind + 1);
}
inline pair<int, int> query(int s, int e, int ind, int l, int r) {
  if (s >= r || e <= l) return {-inf, -1};
  if (s >= l && e <= r) return seg[ind];
  int mid = (s + e) / 2;
  pair<int, int> u = {-inf, -1}, v = {-inf, -1};
  if (mid > l) u = query(s, mid, 2 * ind, l, r);
  if (mid < r) v = query(mid, e, 2 * ind + 1, l, r);
  return u.first > v.first ? u : v;
}
inline void add(int s, int e, int ind, int l, int r, pair<int, int> v) {
  if (s >= r || e <= l) return;
  if (s >= l && e <= r) {
    if (v.first > seg[ind].first) seg[ind] = v;
    return;
  }
  int mid = (s + e) / 2;
  if (mid > l) add(s, mid, 2 * ind, l, r, v);
  if (mid < r) add(mid, e, 2 * ind + 1, l, r, v);
  seg[ind] = seg[2 * ind].first > seg[2 * ind + 1].first ? seg[2 * ind]
                                                         : seg[2 * ind + 1];
}
inline void Dfs(int v, int p, int d, int s, int mx) {
  if (d > r) return;
  for (pair<int, int> x : g[v]) {
    int u = x.first, w = x.second;
    if (!mark[u] && u != p && d + 1 < r) {
      int y = 1;
      if (w < med) y = -1;
      Dfs(u, v, d + 1, s + y, mx);
    }
  }
  int lef = max(0, l - d), rig = min(r - d, mx);
  if (lef > mx || rig < 0 || rig < lef) return;
  a.push_back({{d, s}, v});
  pair<int, int> x = query(0, r + 1, 1, lef, rig + 1);
  if (x.first + s >= 0) {
    frs = x.second;
    lst = v;
  }
}
inline bool calc(int v, int sz) {
  frs = -1, lst = -1;
  add(0, r + 1, 1, 0, 1, {0, v});
  for (pair<int, int> x : g[v]) {
    if (mark[x.first]) continue;
    Dfs(x.first, v, 1, x.second >= med ? 1 : -1, sz - 1);
    for (auto y : a) {
      int d = y.first.first, s = y.first.second, ind = y.second;
      add(0, r + 1, 1, d, d + 1, {s, ind});
    }
    a.clear();
  }
  return frs != -1 ? true : false;
}
inline bool check() {
  for (int i = 0; i < cnt; i++) {
    mark[centroid[i].first] = true;
    if (calc(centroid[i].first, centroid[i].second)) {
      clean();
      for (int j = i; j >= 0; j--) mark[centroid[i].first] = false;
      return true;
    }
    clean();
  }
  for (int i = 0; i < cnt; i++) mark[centroid[i].first] = false;
  return false;
}
inline void dfs(int v, int p) {
  int mx = 0, sum = 0;
  sm++;
  vec.push_back(v);
  for (auto u : g[v])
    if (!mark[u.first] && u.first != p) {
      dfs(u.first, v);
      mx = max(mx, down[u.first]);
      sum += down[u.first];
    }
  down[v] = sum + 1;
  mx_down[v] = mx;
}
inline void find_centroid(int v) {
  sm = 0;
  dfs(v, v);
  int cent = -1;
  for (int u : vec)
    if (mx_down[u] <= sm / 2 && sm - down[u] <= sm / 2) cent = u;
  if (sm > l) centroid[cnt++] = {cent, sm};
  mark[cent] = true;
  vec.clear();
  for (auto u : g[cent])
    if (!mark[u.first]) find_centroid(u.first);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 0; i < n; i++) g[i].reserve(10);
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    u--;
    v--;
    e[i] = w;
    g[u].push_back({v, w});
    g[v].push_back({u, w});
  }
  sort(e, e + n - 1);
  find_centroid(0);
  clean();
  memset(mark, 0, sizeof(mark));
  pair<int, int> ret = {-1, -1};
  int low = -1, high = n - 1;
  while (high - low > 1) {
    int mid = (low + high) / 2;
    med = e[mid];
    if (check()) {
      low = mid;
      ret.first = frs;
      ret.second = lst;
    } else
      high = mid;
  }
  printf("%d %d", ret.first + 1, ret.second + 1);
  return 0;
}