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>
#pragma GCC optimize "O3"
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int INF = 1e9 + 7;
int n;
int SZ;
int centro;
int mini, maxi;
int find_centro(int start, vector<int>& odw,
                vector<vector<pair<int, int> > >& G, int przodek = -1) {
  int ret = 1;
  bool ok = 1;
  for (auto& u : G[start])
    if (!odw[u.first] and u.first != przodek) {
      int pom = find_centro(u.first, odw, G, start);
      ok &= (pom * 2 <= SZ);
      ret += pom;
    }
  if (ok and ret * 2 >= SZ) centro = start;
  return ret;
}
void dfs(int start, vector<int>& odw, vector<vector<pair<int, int> > >& G,
         vector<pair<int, int> >& temp, int przodek, int suma, int gl) {
  if ((int)temp.size() == gl)
    temp.emplace_back(suma, start);
  else
    temp[gl] = max(temp[gl], make_pair(suma, start));
  for (auto& u : G[start])
    if (u.first != przodek and !odw[u.first])
      dfs(u.first, odw, G, temp, start, suma + u.second, gl + 1);
}
struct seg_tree {
  int T = 1;
  vector<pair<int, int> > tree;
  seg_tree() {}
  seg_tree(int x) {
    while (T <= x + 2) T *= 2;
    tree = vector<pair<int, int> >(T * 2, {-INF, -INF});
  }
  void set_max(int poz, pair<int, int> val) {
    poz += T;
    tree[poz] = max(tree[poz], val);
    while (poz /= 2) tree[poz] = max(tree[poz + poz], tree[poz + poz + 1]);
  }
  pair<int, int> ask(int pocz, int kon) {
    pocz += T;
    kon += T;
    pair<int, int> ret = max(tree[pocz], tree[kon]);
    while (pocz / 2 != kon / 2) {
      if (pocz % 2 == 0) ret = max(ret, tree[pocz + 1]);
      if (kon % 2 == 1) ret = max(ret, tree[kon - 1]);
      pocz /= 2;
      kon /= 2;
    }
    return ret;
  }
};
pair<int, int> decompose(int start, vector<int>& odw,
                         vector<vector<pair<int, int> > >& G) {
  SZ = find_centro(start, odw, G);
  if (SZ <= mini) return {-1, -1};
  find_centro(start, odw, G);
  int akt_centro = centro;
  odw[akt_centro] = 1;
  pair<int, int> ret = {-1, -1};
  seg_tree tree_xd(SZ + 2);
  tree_xd.set_max(0, {0, akt_centro});
  for (auto& u : G[akt_centro])
    if (odw[u.first] == 0) {
      vector<pair<int, int> > temp = {{0, akt_centro}};
      dfs(u.first, odw, G, temp, akt_centro, u.second, 1);
      for (int i = 1; i < (int)temp.size(); i++) {
        int lo = max(0, mini - i);
        if (lo >= tree_xd.T) continue;
        int hi = min(maxi - i, tree_xd.T - 1);
        if (hi >= 0) {
          pair<int, int> pom = tree_xd.ask(lo, hi);
          if (pom.first + temp[i].first >= 0)
            return {pom.second, temp[i].second};
        }
      }
      for (int i = 1; i < (int)temp.size(); i++) tree_xd.set_max(i, temp[i]);
    }
  for (auto& u : G[akt_centro])
    if (odw[u.first] == 0) ret = max(ret, decompose(u.first, odw, G));
  return ret;
}
pair<int, int> rob(int bound, vector<vector<pair<int, int> > >& G) {
  vector<vector<pair<int, int> > > G2(n);
  for (int i = 0; i < n; i++)
    for (auto& u : G[i])
      G2[i].push_back({u.first, (u.second >= bound) ? 1 : -1});
  vector<int> odw(n);
  return decompose(0, odw, G2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> mini >> maxi;
  vector<vector<pair<int, int> > > G(n);
  int max_val = 0;
  vector<int> vals;
  for (int i = 1; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    max_val = max(max_val, c);
    vals.push_back(c);
    G[a].push_back({b, c});
    G[b].push_back({a, c});
  }
  sort(vals.begin(), vals.end());
  vals.resize(unique(vals.begin(), vals.end()) - vals.begin());
  int L = 0;
  int R = (int)vals.size();
  pair<int, int> ans = rob(vals[0], G);
  while (R - L > 1) {
    int mid = (R + L) / 2;
    auto pom = rob(vals[mid], G);
    if (pom == make_pair(-1, -1)) {
      R = mid;
    } else {
      L = mid;
      ans = pom;
    }
  }
  cout << ans.first + 1 << ' ' << ans.second + 1 << '\n';
}