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 = 4e5 + 10, INF = 1e9 + 7;
int n, l, r, frst, last, med, cnt, wei[N], sz[N];
pair<int, int> b[N], cen[N], ans;
vector<pair<int, int> > adj[N];
vector<pair<pair<int, int>, int> > a;
bool vis[N];
void CLEAR(int S, int E, int i);
pair<int, int> query(int S, int E, int i, int x, int y);
void add(int S, int E, int i, int x, int y, pair<int, int> p);
void dfs(int v, int par, int dis, int S, int MAX);
bool calc(pair<int, int> v);
bool possible();
void dfscen(int v, int par);
void centroid(int v);
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> l >> r;
  for (int i = 0; i < (n - 1); i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    wei[i] = w;
    adj[u].push_back({v, w});
    adj[v].push_back({u, w});
  }
  solve();
  cout << ans.first + 1 << " " << ans.second + 1 << '\n';
  return 0;
}
void CLEAR(int S, int E, int i) {
  if (b[i].first == -INF) return;
  b[i] = {-INF, -1};
  if (E - S < 2) return;
  int mid = (S + E) / 2;
  if (b[2 * i].first != -INF) CLEAR(S, mid, 2 * i);
  if (b[2 * i + 1].first != -INF) CLEAR(mid, E, 2 * i + 1);
}
pair<int, int> query(int S, int E, int i, int x, int y) {
  if (S >= y || E <= x) return {-INF, -1};
  if (S >= x && E <= y) return b[i];
  int mid = (S + E) / 2;
  pair<int, int> p1 = make_pair(-INF, -1), p2 = make_pair(-INF, -1);
  if (mid > x) p1 = query(S, mid, 2 * i, x, y);
  if (mid < y) p2 = query(mid, E, 2 * i + 1, x, y);
  return ((p1.first > p2.first) ? p1 : p2);
}
void add(int S, int E, int i, int x, int y, pair<int, int> p) {
  if (S >= y || E <= x) return;
  if (S >= x && E <= y) {
    if (p.first > b[i].first) b[i] = p;
    return;
  }
  int mid = (S + E) / 2;
  if (mid > x) add(S, mid, 2 * i, x, y, p);
  if (mid < y) add(mid, E, 2 * i + 1, x, y, p);
  b[i] = ((b[2 * i].first > b[2 * i + 1].first) ? b[2 * i] : b[2 * i + 1]);
}
void dfs(int v, int par, int dis, int S, int MAX) {
  if (dis > r) return;
  for (auto p : adj[v])
    if (!vis[p.first] && p.first != par && dis + 1 < r)
      (p.second < med) ? dfs(p.first, v, dis + 1, S - 1, MAX)
                       : dfs(p.first, v, dis + 1, S + 1, MAX);
  int x = max(0, l - dis), y = min(r - dis, MAX);
  if (x > MAX || y < x) return;
  a.push_back({{dis, S}, v});
  pair<int, int> tmp = query(0, r + 1, 1, x, y + 1);
  if ((S + tmp.first) >= 0) {
    frst = tmp.second;
    last = v;
  }
}
bool calc(pair<int, int> v) {
  frst = -1, last = -1;
  add(0, r + 1, 1, 0, 1, {0, v.first});
  for (auto p : adj[v.first])
    if (!vis[p.first]) {
      dfs(p.first, v.first, 1, ((p.second >= med) ? 1 : -1), v.second - 1);
      for (auto pp : a)
        add(0, r + 1, 1, pp.first.first, pp.first.first + 1,
            {pp.first.second, pp.second});
      a.clear();
    }
  return ((frst != -1) ? 1 : 0);
}
bool possible() {
  for (int i = 0; i < cnt; i++) {
    vis[cen[i].first] = 1;
    if (calc(cen[i])) {
      CLEAR(0, r + 1, 1);
      for (int j = i; j >= 0; j--) vis[cen[i].first] = 0;
      return 1;
    }
    CLEAR(0, r + 1, 1);
  }
  for (int i = 0; i < cnt; i++) vis[cen[i].first] = 0;
  return 0;
}
void dfscen(int v, int par) {
  sz[v] = 1;
  for (auto p : adj[v])
    if (!vis[p.first] && p.first != par)
      dfscen(p.first, v), sz[v] += sz[p.first];
}
void centroid(int v) {
  dfscen(v, -1);
  int tmp = sz[v], C = sz[v] / 2, par = -1;
  while (1) {
    bool found = 1;
    for (auto p : adj[v])
      if (!vis[p.first] && p.first != par && sz[p.first] > C) {
        found = 0, par = v, v = p.first;
        break;
      }
    if (found) break;
  }
  if (tmp > l) cen[cnt++] = {v, tmp};
  vis[v] = 1;
  for (auto p : adj[v])
    if (!vis[p.first]) centroid(p.first);
}
void solve() {
  sort(wei, wei + n - 1);
  centroid(0);
  CLEAR(0, r + 1, 1);
  memset(vis, 0, sizeof(vis));
  int S = -1, E = n - 1;
  while (E - S > 1) {
    int mid = (S + E) / 2;
    med = wei[mid];
    if (possible()) {
      S = mid;
      ans.first = frst;
      ans.second = last;
    } else
      E = mid;
  }
}