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;
struct Seg_T {
  int n;
  pair<int, int> dat[8 * 100010];
  void init(int _n) {
    for (n = 1; n < _n; n *= 2)
      ;
    for (int i = 1; i < 4 * n; i++) dat[i] = make_pair(-1000000000, -1);
  }
  void ins(int p, pair<int, int> v) {
    p += n + 1;
    for (; p >= 1 && v > dat[p]; p /= 2) dat[p] = v;
  }
  pair<int, int> rmq(int st, int ed) {
    if (st > ed) return make_pair(-1000000000, -1);
    st += n;
    ed += n + 2;
    pair<int, int> r = make_pair(-1000000000, -1);
    while (st ^ ed ^ 1) {
      if (~st & 1) r = max(r, dat[st ^ 1]);
      if (ed & 1) r = max(r, dat[ed ^ 1]);
      st >>= 1;
      ed >>= 1;
    }
    return r;
  }
} seg;
struct E {
  int to, val;
  E() {}
  E(int _to, int _val) : to(_to), val(_val) {}
};
int n, lb, ub, st, ed, ans = -1, gap, vis[100010], who[100010], dis[100010],
                       val[100010], fa[100010], sz[100010], nn, q[100010], fr,
                       bk, big[100010];
vector<E> e[100010];
int get_root(int p) {
  nn = fr = bk = 0;
  q[bk++] = p;
  fa[p] = -1;
  while (fr != bk) {
    who[nn++] = p = q[fr++];
    for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
      if (!vis[it->to] && it->to != fa[p]) {
        fa[it->to] = p;
        q[bk++] = it->to;
      }
  }
  int w = p, sml = 1000000000;
  for (int i = nn - 1; i >= 0; i--) {
    sz[p = who[i]] = 1;
    for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
      if (!vis[it->to] && it->to != fa[p]) sz[p] += sz[it->to];
    int bl = nn - sz[p];
    for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
      if (!vis[it->to] && it->to != fa[p]) bl = max(bl, sz[it->to]);
    if (bl < sml) sml = bl, w = p;
  }
  return w;
}
void dfs(int p, int f, int d, int v) {
  who[nn] = p;
  dis[nn] = d;
  val[nn] = v;
  nn++;
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (!vis[it->to] && it->to != f)
      dfs(it->to, p, d + 1, v + (it->val >= gap ? 1 : -1));
}
bool chk(int p, int sn) {
  seg.init(sn + 5);
  seg.ins(0, make_pair(0, p));
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (!vis[it->to]) {
      nn = 0;
      dfs(it->to, p, 1, it->val >= gap ? 1 : -1);
      for (int i = 0; i < nn; i++)
        if (ub - dis[i] >= 0) {
          pair<int, int> now =
              seg.rmq(max(lb - dis[i], 0), min(ub - dis[i], sn));
          if (val[i] + now.first >= 0) {
            st = who[i];
            ed = now.second;
            return 1;
          }
        }
      for (int i = 0; i < nn; i++) seg.ins(dis[i], make_pair(val[i], who[i]));
    }
  return 0;
}
void go(int p) {
  vis[p = get_root(p)] = 1;
  nn = 0;
  dfs(p, 0, 0, 0);
  int sn = *max_element(dis, dis + nn), L = ans, R = 1000000000;
  while (L != R) {
    gap = (L + R + 1) / 2;
    if (chk(p, sn))
      ans = L = gap;
    else
      R = gap - 1;
  }
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (!vis[it->to]) go(it->to);
}
int main() {
  scanf("%d%d%d", &n, &lb, &ub);
  for (int i = 1; i < n; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    e[a].push_back(E(b, c));
    e[b].push_back(E(a, c));
  }
  go(1);
  printf("%d %d\n", st, ed);
  return 0;
}