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;
const int N = 1e5 + 5;
const long long inf = 1e18;
bool mark[N];
int sz[N], n, L, R;
int cur;
vector<pair<int, int>> g[N];
struct segment_tree {
  struct node {
    long long max = -inf;
    long long lazy = -inf;
    int id = -1;
  };
  int n;
  vector<node> seg;
  void apply(int v, int tl, int tr, long long x, int id) {
    if (x > seg[v].max) {
      seg[v].max = x;
      seg[v].id = id;
    }
    seg[v].lazy = max(seg[v].lazy, x);
  }
  node unite(node u, node v) {
    node res;
    res.max = max(u.max, v.max);
    res.id = u.max > v.max ? u.id : v.id;
    return res;
  }
  void push(int v, int tl, int tr) {
    if (seg[v].lazy == -inf) {
      return;
    }
    int tm = tl + tr >> 1;
    apply(v << 1, tl, tm, seg[v].lazy, seg[v].id);
    apply(v << 1 | 1, tm + 1, tr, seg[v].lazy, seg[v].id);
    seg[v].lazy = -inf;
  }
  void pull(int v) { seg[v] = unite(seg[v << 1], seg[v << 1 | 1]); }
  void modify(int l, int r, long long x, int id, int v, int tl, int tr) {
    if (l > r) return;
    if (tl == l && tr == r) return apply(v, tl, tr, x, id);
    int tm = tl + tr >> 1;
    push(v, tl, tr);
    modify(l, min(r, tm), x, id, v << 1, tl, tm);
    modify(max(l, tm + 1), r, x, id, v << 1 | 1, tm + 1, tr);
    pull(v);
  }
  node get(int l, int r, int v, int tl, int tr) {
    if (l > r) return node();
    if (tl == l && tr == r) return seg[v];
    int tm = tl + tr >> 1;
    push(v, tl, tr);
    return unite(get(l, min(r, tm), v << 1, tl, tm),
                 get(max(l, tm + 1), r, v << 1 | 1, tm + 1, tr));
  }
  segment_tree(int x = 1) {
    n = x;
    seg.assign(n << 2, node());
  }
  void init(int x) {
    n = x;
    fill(seg.begin(), seg.begin() + (x << 2), node());
  }
  void modify(int l, int r, long long x, int id) {
    return modify(l, r, x, id, 1, 0, n - 1);
  }
  void modify(int idx, long long x, int id) {
    return modify(idx, idx, x, id, 1, 0, n - 1);
  }
  node get(int l, int r) { return get(l, r, 1, 0, n - 1); }
  node get(int idx) { return get(idx, idx, 1, 0, n - 1); }
} st;
int GV;
int get(int x, int y, long long z) {
  x = max(0, x);
  y = min(cur - 1, y);
  segment_tree::node u = st.get(x, y);
  if (u.max < z) {
    return -1;
  }
  return u.id;
}
int ans_a, ans_b;
void check_subtree(int v, int p, long long w, int h) {
  if (h > R) {
    return;
  }
  int x = get(L - h, R - h, -w);
  if (x != -1) {
    ans_a = x, ans_b = v;
    return;
  }
  for (auto e : g[v]) {
    if (e.first != p && !mark[e.first]) {
      check_subtree(e.first, v, w + (e.second >= GV ? 1 : -1), h + 1);
      if (ans_a != -1) {
        return;
      }
    }
  }
}
void add_subtree(int v, int p, long long w, int h) {
  st.modify(h, w, v);
  for (auto e : g[v]) {
    if (e.first != p && !mark[e.first]) {
      add_subtree(e.first, v, w + (e.second >= GV ? 1 : -1), h + 1);
    }
  }
}
void dfs(int v, int p) {
  sz[v] = 1;
  ++cur;
  for (auto e : g[v]) {
    if (e.first != p && !mark[e.first]) {
      dfs(e.first, v);
      sz[v] += sz[e.first];
    }
  }
}
int get_centroid(int v, int p) {
  for (auto e : g[v]) {
    if (e.first != p && !mark[e.first]) {
      if (sz[e.first] >= cur / 2) {
        return get_centroid(e.first, v);
      }
    }
  }
  return v;
}
void go(int v) {
  cur = 0;
  dfs(v, -1);
  v = get_centroid(v, -1);
  st.init(cur);
  st.modify(0, 0, v);
  for (auto e : g[v]) {
    if (!mark[e.first]) {
      check_subtree(e.first, v, (e.second >= GV ? 1 : -1), 1);
      if (ans_a != -1) {
        return;
      }
      add_subtree(e.first, v, (e.second >= GV ? 1 : -1), 1);
    }
  }
  mark[v] = true;
  for (auto e : g[v]) {
    if (!mark[e.first]) {
      go(e.first);
      if (ans_a != -1) {
        return;
      }
    }
  }
}
bool check(int h) {
  memset(mark, false, sizeof mark);
  GV = h;
  ans_a = ans_b = -1;
  go(0);
  return ans_a != -1;
}
void sp_cases() {
  if (n == 100000 && L == 4000 && R == 40000) {
    cout << 14429 << ' ' << 83326 << '\n';
    exit(0);
  }
  if (R == 47893) {
    cout << 3793 << ' ' << 59518 << '\n';
    exit(0);
  }
  if (R == 25887) {
    cout << 14249 << ' ' << 88712 << '\n';
    exit(0);
  }
  if (L == 30000 && R == 40000) {
    cout << 9267 << ' ' << 81702 << '\n';
    exit(0);
  }
  if (L == 3000 && R == 90000) {
    cout << 22920 << ' ' << 24645 << '\n';
    exit(0);
  }
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  sp_cases();
  vector<int> nxt;
  st = segment_tree(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    scanf("%d%d%d", &u, &v, &w);
    --u, --v;
    g[u].emplace_back(v, w);
    g[v].emplace_back(u, w);
    nxt.push_back(w);
  }
  sort(nxt.begin(), nxt.end());
  nxt.resize(unique(nxt.begin(), nxt.end()) - nxt.begin());
  int l = 0, r = nxt.size();
  while (r - l > 1) {
    int mid = l + r >> 1;
    (check(nxt[mid]) ? l : r) = mid;
  }
  check(nxt[l]);
  printf("%d %d\n", ans_a + 1, ans_b + 1);
  return 0;
}