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 maxn = 400000;
struct Queue {
  vector<int> st1, st2;
  vector<int> mx1, mx2;
  Queue() { clear(); }
  void clear() {
    st1.clear();
    st2.clear();
    mx1.clear();
    mx2.clear();
  }
  void add(int x) {
    int mx = x;
    if (!st2.empty()) mx = max(mx, mx2.back());
    st2.push_back(x);
    mx2.push_back(mx);
  }
  void add1(int x) {
    int mx = x;
    if (!st1.empty()) mx = max(mx, mx1.back());
    st1.push_back(x);
    mx1.push_back(mx);
  }
  void pop() {
    if (st1.empty()) {
      while (!st2.empty()) {
        add1(st2.back());
        st2.pop_back();
        mx2.pop_back();
      }
    }
    if (!st1.empty()) {
      st1.pop_back();
      mx1.pop_back();
    }
  }
  int Max() {
    int mx = -(1 << 30);
    if (!st1.empty()) mx = max(mx1.back(), mx);
    if (!st2.empty()) mx = max(mx2.back(), mx);
    return mx;
  }
} Q;
vector<vector<pair<int, int> > > gi, g;
int L, R, n, T[maxn], Ta[maxn], ans, size[maxn], weight, pos2, pos, maxdep;
void CalcSize(int v, int parent) {
  size[v] = 1;
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    if (to == parent) continue;
    CalcSize(to, v);
    size[v] += size[to];
  }
}
int get(int v, int parent) {
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    if (to == parent) continue;
    if (size[to] > (n >> 1)) return get(to, v);
  }
  return v;
}
void upd_ans(int tmp, int v) {
  if (ans < tmp) {
    ans = tmp;
    pos = v;
  }
}
void Calc(int v, int parent, int dep, int sum) {
  upd_ans(Ta[dep] + sum, v);
  if (ans >= 0) return;
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    if (to == parent) continue;
    Calc(to, v, dep + 1, sum + it->second);
  }
}
void upd(int v, int parent, int dep, int sum) {
  T[dep] = max(T[dep], sum);
  maxdep = max(dep, maxdep);
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    if (to == parent) continue;
    upd(to, v, dep + 1, sum + it->second);
  }
}
void Solve(int v) {
  CalcSize(v, -1);
  n = size[v];
  if (n < L) return;
  for (int i = 1; i <= n; ++i) T[i] = -(1 << 30), Ta[i] = -(1 << 30);
  T[0] = Ta[0] = 0;
  v = get(v, -1);
  maxdep = 0;
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    int l = max(L - 1, 0), r = max(min(R - 1, maxdep), l);
    Q.clear();
    for (int i = r; i >= l; --i) Q.add(T[i]);
    Ta[1] = max(Ta[1], Q.Max());
    for (int dep = 2; dep <= size[to]; ++dep) {
      if (r >= 0 && R - dep + 1 == r) --r, Q.pop();
      if (L - dep >= 0) Q.add(T[L - dep]);
      Ta[dep] = max(Ta[dep], Q.Max());
    }
    Calc(to, v, 1, it->second);
    if (ans >= 0) return;
    maxdep = 0;
    upd(to, v, 1, it->second);
  }
  for (typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); ++it) {
    int to = it->first;
    int w = it->second;
    int pos = -1;
    for (int i = 0; i < g[to].size(); ++i)
      if (g[to][i].first == v) pos = i;
    swap(g[to][pos], g[to][(int)g[to].size() - 1]);
    g[to].pop_back();
    Solve(to);
    g[to].push_back(make_pair(v, w));
    swap(g[to][pos], g[to][(int)g[to].size() - 1]);
  }
}
bool Ok(int x) {
  g = gi;
  n = gi.size();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < g[i].size(); ++j)
      if (g[i][j].second < x)
        g[i][j].second = -1;
      else
        g[i][j].second = 1;
  }
  ans = -(1 << 30);
  Solve(0);
  return (ans >= 0);
}
bool Dfs(int v, int parent, int len, int sum) {
  if (L <= len && len <= R && sum >= 0) {
    pos2 = v;
    return true;
  }
  for (typeof(gi[v].begin()) it = gi[v].begin(); it != gi[v].end(); ++it) {
    int to = it->first;
    if (to == parent) continue;
    if (it->second < weight)
      Dfs(to, v, len + 1, sum - 1);
    else if (Dfs(to, v, len + 1, sum + 1))
      return true;
  }
  return false;
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  gi.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v, cost;
    scanf("%d%d%d", &u, &v, &cost);
    u--;
    v--;
    gi[u].push_back(make_pair(v, cost));
    gi[v].push_back(make_pair(u, cost));
  }
  int l = 0, r = (1 << 30) + 1000;
  while (r - 1 > l) {
    int mid = (l + r) >> 1;
    if (Ok(mid))
      l = mid;
    else
      r = mid;
  }
  Ok(l);
  weight = l;
  Dfs(pos, -1, 0, 0);
  cout << pos + 1 << " " << pos2 + 1 << endl;
  return 0;
}