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 std::cerr;
using std::endl;
const int N = 1e5 + 5;
int n, L, R;
std::vector<std::pair<int, int>> G[N];
int now_x, now_y, mid, ok;
inline int get_val(std::pair<int, int> p) { return p.second >= mid ? 1 : -1; }
int vis[N];
int get_size(int x, int fa) {
  int ret = 1;
  for (auto i : G[x]) {
    int y = i.first;
    if (!vis[y] && y != fa) ret += get_size(y, x);
  }
  return ret;
}
int all, min_tree, pos;
int get_pos(int x, int fa) {
  int ret = 1, max = 0;
  for (auto i : G[x]) {
    int y = i.first;
    if (!vis[y] && y != fa) {
      int tmp = get_pos(y, x);
      max = std::max(max, tmp);
      ret += tmp;
    }
  }
  max = std::max(max, all - ret);
  if (max < min_tree) {
    min_tree = max;
    pos = x;
  }
  return ret;
}
int buc[N], buc_pt[N], top;
int way[N], way_pt[N], max_dep, tag[N], ver;
void get_way(int x, int dep, int sum, int fa) {
  if (tag[dep] != ver) way[dep] = -1e9, tag[dep] = ver;
  if (sum > way[dep]) {
    way[dep] = sum;
    way_pt[dep] = x;
  }
  max_dep = std::max(max_dep, dep);
  for (auto i : G[x]) {
    int y = i.first;
    if (!vis[y] && y != fa) get_way(y, dep + 1, sum + get_val(i), x);
  }
}
int que[N], ql, qr, nl, nr;
inline bool merge(int lim) {
  ql = 1, qr = 0;
  nl = std::max(L - max_dep, 0);
  nr = nl - 1;
  for (int i = max_dep; i; --i) {
    while (nr < R - i && nr < lim) {
      while (ql <= qr && buc[que[qr]] <= buc[nr + 1]) --qr;
      que[++qr] = ++nr;
    }
    while (nl < L - i) {
      if (ql <= qr && que[ql] == nl) ++ql;
      ++nl;
    }
    if (ql <= qr && buc[que[ql]] + way[i] >= 0) {
      now_x = buc_pt[que[ql]];
      now_y = way_pt[i];
      return 1;
    }
  }
  for (int i = 1; i <= max_dep; ++i) {
    if (buc[i] < way[i]) {
      buc[i] = way[i];
      buc_pt[i] = way_pt[i];
    }
  }
  top = std::max(top, max_dep);
  return 0;
}
void divide(int x) {
  all = get_size(x, 0), min_tree = 1e9;
  if (all == 1) return;
  get_pos(x, 0), x = pos, vis[x] = 1;
  std::vector<std::pair<int, std::pair<int, int>>> son;
  for (auto i : G[x]) {
    int y = i.first;
    if (!vis[y]) son.emplace_back(get_size(y, x), i);
  }
  std::sort(son.begin(), son.end());
  for (int i = 0; i <= son.back().first; ++i) buc[i] = way[i] = -1e9;
  buc[0] = top = 0, buc_pt[0] = x;
  for (auto i : son) {
    int y = i.second.first, v = get_val(i.second);
    ++ver, max_dep = 0;
    get_way(y, 1, v, x);
    if (merge(top)) {
      ok = 1;
      break;
    }
  }
  if (ok) return;
  for (auto i : G[x]) {
    int y = i.first;
    if (!vis[y]) {
      divide(y);
      if (ok) return;
    }
  }
}
inline bool check() {
  memset(vis, 0, sizeof(vis));
  ok = 0, divide(1);
  return ok;
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  int l = 1e9, r = -l;
  for (int i = 1; i < n; ++i) {
    int x, y, w;
    scanf("%d%d%d", &x, &y, &w);
    G[x].emplace_back(y, w);
    G[y].emplace_back(x, w);
    l = std::min(l, w);
    r = std::max(r, w);
  }
  int ans_x = -1, ans_y = -1;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check()) {
      l = mid + 1, ans_x = now_x, ans_y = now_y;
    } else
      r = mid - 1;
  }
  printf("%d %d\n", ans_x, ans_y);
  return 0;
}