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 N = 100005;
const int inf = 1000000000;
int n, L, R, cnt, last[N], w[N], size[N], root, sum, f[N], d[N], g[N], dep[N],
    que[N], ans, dn[N], gn[N], a1, a2;
bool vis[N], bu[N];
struct data {
  int to, val, w;
};
std::vector<data> vec[N];
int max(int x, int y) { return x > y ? x : y; }
int min(int x, int y) { return x < y ? x : y; }
void get_root(int x, int fa) {
  size[x] = 1;
  f[x] = 0;
  for (int i = 0; i < vec[x].size(); i++) {
    int to = vec[x][i].to;
    if (to == fa || vis[to]) continue;
    get_root(to, x);
    size[x] += size[to];
    f[x] = max(f[x], size[to]);
  }
  f[x] = max(f[x], sum - size[x]);
  if (!root || f[x] < f[root]) root = x;
}
bool cmp(data x, data y) { return dep[x.to] < dep[y.to]; }
void get_dep(int x, int fa) {
  dep[x] = 0;
  for (int i = 0; i < vec[x].size(); i++) {
    int to = vec[x][i].to;
    if (to != fa && !vis[to]) get_dep(to, x), dep[x] = max(dep[x], dep[to] + 1);
  }
}
void build(int x) {
  if (vec[x].size()) return;
  for (int i = 0; i < vec[x].size(); i++) {
    if (vis[vec[x][i].to]) continue;
    get_dep(vec[x][i].to, x);
  }
  sort(vec[x].begin(), vec[x].end(), cmp);
}
void get(int x, int fa, int dep, int val) {
  if (val > g[dep]) g[dep] = val, gn[dep] = x;
  size[x] = 1;
  for (int i = 0; i < vec[x].size(); i++) {
    int to = vec[x][i].to;
    if (to != fa && !vis[to])
      get(to, x, dep + 1, val + vec[x][i].w), size[x] += size[to];
  }
}
void solve(int x) {
  vis[x] = 1;
  if (!bu[x]) build(x), bu[x] = 1;
  d[0] = 0;
  dn[0] = x;
  int mx = 0;
  for (int i = 0; i < vec[x].size(); i++) {
    int to = vec[x][i].to;
    if (vis[to]) continue;
    get(to, x, 1, vec[x][i].w);
    int l = 1, r = 0;
    for (int j = min(R - 1, mx); j >= L; j--) {
      while (l <= r && d[que[r]] <= d[j]) r--;
      que[++r] = j;
    }
    for (int j = 1; g[j] > -inf; j++) {
      if (L - j >= 0) {
        while (l <= r && d[que[r]] <= d[L - j]) r--;
        que[++r] = L - j;
      }
      while (l <= r && que[l] > R - j) l++;
      if (l <= r && g[j] + d[que[l]] > ans)
        ans = g[j] + d[que[l]], a1 = gn[j], a2 = dn[que[l]];
    }
    for (int j = 1; g[j] > -inf; j++) {
      if (g[j] > d[j]) d[j] = g[j], dn[j] = gn[j];
      g[j] = -inf;
      mx = max(mx, j);
    }
  }
  for (int i = 1; d[i] > -inf; i++) d[i] = -inf;
  for (int i = 0; i < vec[x].size(); i++) {
    if (vis[vec[x][i].to]) continue;
    root = 0;
    sum = size[vec[x][i].to];
    get_root(vec[x][i].to, x);
    solve(root);
  }
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  for (int i = 1; i < n; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    vec[x].push_back((data){y, z});
    vec[y].push_back((data){x, z});
    w[i] = z;
  }
  std::sort(w + 1, w + n);
  int w1 = std::unique(w + 1, w + n) - w - 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < vec[i].size(); j++)
      vec[i][j].val = std::lower_bound(w + 1, w + w1 + 1, vec[i][j].val) - w;
  for (int i = 0; i <= n; i++) d[i] = g[i] = -inf;
  int l = 1, r = w1, b1, b2;
  while (l <= r) {
    int mid = (l + r) / 2;
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < vec[i].size(); j++)
        vec[i][j].w = vec[i][j].val >= mid ? 1 : -1;
    for (int i = 1; i <= n; i++) vis[i] = 0;
    root = 0;
    sum = n;
    get_root(1, 0);
    ans = -inf;
    solve(root);
    if (ans >= 0)
      l = mid + 1, b1 = a1, b2 = a2;
    else
      r = mid - 1;
  }
  printf("%d %d", b1, b2);
  return 0;
}