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>
const int MAXN = 1e5 + 5;
inline char nc() {
  static char buf[1000000 + 3], *p1 = buf + 1000000 + 3,
                                *p2 = buf + 1000000 + 3;
  if (p1 == p2) {
    p1 = buf;
    p2 = buf + fread(buf, 1, 1000000 + 3, stdin);
    if (p1 == p2) return -1;
  }
  return *p1++;
}
template <typename T>
inline void read(T &x) {
  x = 0;
  int flag = 0;
  char ch = nc();
  while (!isdigit(ch)) {
    if (ch == '-') flag = 1;
    ch = nc();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ '0');
    ch = nc();
  }
  if (flag) x = -x;
}
struct Edge {
  int u, v, w;
} e[MAXN];
int n, L, R;
std::vector<std::pair<int, int> > G[MAXN];
int mx[MAXN], sz[MAXN], rt;
bool vis[MAXN];
int sx = -1, sy = -1;
inline void getroot(int v, int fa = 0) {
  sz[v] = 1;
  mx[v] = 0;
  for (auto x : G[v]) {
    if (vis[x.first] || x.first == fa) continue;
    getroot(x.first, v);
    sz[v] += sz[x.first];
    mx[v] = std::max(mx[v], sz[x.first]);
  }
  mx[v] = std::max(mx[v], mx[0] - sz[v]);
  if (mx[v] < mx[rt]) rt = v;
}
std::vector<std::pair<int, int> > S[MAXN];
inline void dfs(int v, int rt, int dep, int dis, int fa = 0) {
  while (((int)S[rt].size()) < dep + 1) S[rt].emplace_back(-1e9, -1);
  S[rt][dep] = std::max(S[rt][dep], std::make_pair(dis, v));
  for (auto x : G[v]) {
    if (x.first == fa || vis[x.first]) continue;
    dfs(x.first, rt, dep + 1, dis + x.second, v);
  }
}
bool flag = 0;
std::vector<int> rr[MAXN];
inline void work(int v) {
  vis[v] = 1;
  std::vector<int> vec;
  for (auto x : G[v]) {
    if (vis[x.first]) continue;
    S[x.first].clear();
    dfs(x.first, x.first, 1, x.second);
    for (int i = 1; i <= ((int)S[x.first].size()) - 1; ++i)
      if (L <= i && i <= R && S[x.first][i].first >= 0) {
        sx = v;
        sy = S[x.first][i].second;
      }
    vec.emplace_back(x.first);
  }
  if (vec.empty()) return;
  std::sort(vec.begin(), vec.end(), [&](int x, int y) {
    return ((int)S[x].size()) < ((int)S[y].size());
  });
  std::vector<std::pair<int, int> > now = S[vec[0]];
  auto merge = [&](std::vector<std::pair<int, int> > &A,
                   std::vector<std::pair<int, int> > &B) {
    std::deque<int> q;
    int nr = -1;
    for (int i = ((int)B.size()) - 1; i >= 1; --i) {
      int ll = std::max(1, L - i), rr = std::min(((int)A.size()) - 1, R - i);
      if (ll > rr) continue;
      while (nr != rr) {
        ++nr;
        while (!q.empty() && A[q.back()].first <= A[nr].first) q.pop_back();
        q.push_back(nr);
      }
      while (!q.empty() && q.front() < ll) q.pop_front();
      if (q.empty()) continue;
      if (A[q[0]].first + B[i].first >= 0) {
        sx = B[i].second;
        sy = A[q[0]].second;
      }
    }
    for (int i = 0; i <= ((int)A.size()) - 1; ++i) A[i] = std::max(A[i], B[i]);
    for (int i = ((int)A.size()); i <= ((int)B.size()) - 1; ++i)
      A.emplace_back(B[i]);
  };
  for (int i = 1; i <= ((int)vec.size()) - 1; ++i) merge(now, S[vec[i]]);
  int t = 0;
  for (auto x : G[v]) {
    if (vis[x.first]) continue;
    if (!flag) {
      mx[rt = 0] = sz[x.first];
      getroot(x.first);
      rr[v].emplace_back(rt);
    }
    work(rr[v][t++]);
  }
}
int RR;
inline bool chk(int k) {
  for (int i = 1; i <= n - 1; ++i)
    [&](int u, int v, int w) {
      G[u].emplace_back(v, w), G[v].emplace_back(u, w);
    }(e[i].u, e[i].v, e[i].w >= k ? 1 : -1);
  sx = sy = -1;
  if (!RR) {
    mx[rt = 0] = n;
    getroot(1);
    RR = rt;
  }
  work(RR);
  for (int i = 1; i <= n; ++i) G[i].clear(), vis[i] = 0;
  flag = 1;
  return sx != -1;
}
int main() {
  read(n);
  read(L);
  read(R);
  for (int i = 1; i <= n - 1; ++i) read(e[i].u), read(e[i].v), read(e[i].w);
  int l = 0, r = 1e9, ans = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (chk(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  chk(ans);
  printf("%d %d\n", sx, sy);
  return 0;
}