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;
int n, l, r, w[100004], cnt, value;
bool mark[100004];
struct Node {
  int left, right, key, from;
  bool mark;
} tree[100004 * 4];
void build(int left, int right, int step) {
  tree[step].left = left;
  tree[step].right = right;
  tree[step].mark = false;
  tree[step].key = -0x7fffffff;
  if (left == right) return;
  int mid = (left + right) / 2;
  build(left, mid, step * 2);
  build(mid + 1, right, step * 2 + 1);
}
int ask(int left, int right, int step, int &from) {
  if (tree[step].left == left && tree[step].right == right) {
    from = tree[step].from;
    return tree[step].key;
  }
  if (tree[step].mark) {
    tree[step * 2].mark = tree[step * 2 + 1].mark = true;
    tree[step * 2].key = tree[step * 2 + 1].key = 0;
    tree[step].mark = false;
  }
  int mid = (tree[step].left + tree[step].right) / 2;
  if (right <= mid)
    return ask(left, right, step * 2, from);
  else if (left > mid)
    return ask(left, right, step * 2 + 1, from);
  else {
    int f1, f2;
    int ret1 = ask(left, mid, step * 2, f1);
    int ret2 = ask(mid + 1, right, step * 2 + 1, f2);
    ret1 = max(ret1, ret2);
    if (ret1 == ret2)
      from = f2;
    else
      from = f1;
    return ret1;
  }
}
void updata(int i, int key, int from, int step) {
  if (tree[step].left == tree[step].right) {
    tree[step].key = max(tree[step].key, key);
    if (tree[step].key == key) tree[step].from = from;
    return;
  }
  if (tree[step].mark) {
    tree[step * 2].mark = tree[step * 2 + 1].mark = true;
    tree[step * 2].key = tree[step * 2 + 1].key = -0x7fffffff;
    tree[step].mark = false;
  }
  int mid = (tree[step].left + tree[step].right) / 2;
  if (i <= mid)
    updata(i, key, from, step * 2);
  else
    updata(i, key, from, step * 2 + 1);
  tree[step].key = max(tree[step * 2].key, tree[step * 2 + 1].key);
  if (tree[step].key == tree[step * 2].key)
    tree[step].from = tree[step * 2].from;
  else
    tree[step].from = tree[step * 2 + 1].from;
}
struct Edge {
  int to, w, size;
  Edge *next;
} * mat[100004], edges[100004 * 2];
void link(int x, int to, int w) {
  edges[cnt].to = to;
  edges[cnt].w = w;
  edges[cnt].next = mat[x];
  mat[x] = &edges[cnt++];
}
int find_root(int x, int sum, int father, int &root, int &mintree) {
  int size = 1, now = 0;
  for (Edge *p = mat[x]; p; p = p->next) {
    int to = p->to;
    if (to == father || mark[to]) continue;
    int k = find_root(to, sum, x, root, mintree);
    size += k;
    now = max(now, k);
  }
  now = max(now, sum - size);
  if (now < mintree) {
    mintree = now;
    root = x;
  }
  return size;
}
int data[100004], from[100004], st, ed;
int dfs(int x, int father, int w, int L) {
  if (L > cnt) data[++cnt] = w;
  data[L] = max(data[L], w);
  if (data[L] == w) from[L] = x;
  int size = 1;
  for (Edge *p = mat[x]; p; p = p->next) {
    int to = p->to;
    if (to == father || mark[to]) continue;
    size += dfs(to, x, w + (p->w >= value ? 1 : -1), L + 1);
  }
  return size;
}
bool solve(int x) {
  mark[x] = true;
  int min_L = 0, max_L = 0;
  updata(0, 0, x, 1);
  for (Edge *p = mat[x]; p; p = p->next) {
    int to = p->to;
    if (mark[to]) continue;
    cnt = 0;
    p->size = dfs(to, x, (p->w >= value ? 1 : -1), 1);
    cnt = min(cnt, r);
    for (int k = 1; k <= cnt; k++) {
      int g = l - k, h = r - k;
      if (g > max_L) continue;
      g = max(0, g);
      h = min(h, max_L);
      h = max(g, h);
      if (ask(g, h, 1, st) + data[k] >= 0) {
        ed = from[k];
        return true;
      }
    }
    for (int k = 1; k <= cnt; k++) updata(k, data[k], from[k], 1);
    max_L = max(max_L, cnt);
  }
  tree[1].mark = true;
  tree[1].key = -0x7fffffff;
  for (Edge *p = mat[x]; p; p = p->next) {
    int root, mintree = 0x7fffffff, to = p->to;
    if (mark[to]) continue;
    find_root(to, p->size, x, root, mintree);
    if (solve(root)) return true;
  }
  return false;
}
bool pan(int key) {
  int root, mintree = 0x7fffffff;
  value = key;
  memset(mark, false, sizeof(mark));
  find_root(1, n, -1, root, mintree);
  tree[1].mark = true;
  tree[1].key = -0x7fffffff;
  return solve(root);
}
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 0; i < n - 1; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    link(x, y, z);
    link(y, x, z);
    w[i] = z;
  }
  build(0, n, 1);
  sort(w, w + n - 1);
  int g = 0, h = 0;
  for (int i = 1; i < n - 1; i++)
    if (w[i] != w[h]) w[++h] = w[i];
  int ans1, ans2;
  while (g <= h) {
    int mid = (g + h) / 2;
    if (pan(w[mid])) {
      ans1 = st, ans2 = ed;
      g = mid + 1;
    } else
      h = mid - 1;
  }
  printf("%d %d\n", ans1, ans2);
  return 0;
}