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("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma")
using namespace std;
const int N = 2e5 + 10;
const int INF = 1e9;
using pii = pair<int, int>;
vector<pii> adj[N];
vector<int> ed;
bool hide[N];
int sz[N], n, L, R, CN, H[N], C[N];
pii ans, seg[4 * N];
inline pii get(int l, int r) {
  r = min(r, CN - 1);
  r += CN, l += CN;
  pii A = {-INF, -INF};
  while (l < r) {
    if (l & 1) A = max(A, seg[l++]);
    if (r & 1) A = max(A, seg[--r]);
    l >>= 1, r >>= 1;
  }
  return A;
}
inline void upd(int pos, int x, int v) {
  pos += CN;
  while (pos) {
    seg[pos] = max(seg[pos], {x, v});
    pos >>= 1;
  }
}
void plant(int v, int p = 0) {
  sz[v] = 1;
  for (auto [u, w] : adj[v])
    if (u != p && !hide[u]) {
      plant(u, v);
      sz[v] += sz[u];
    }
}
inline int find_centroid(int v, int n, int p = 0) {
  bool found = 1;
  while (found) {
    found = 0;
    for (auto [u, w] : adj[v])
      if (u != p && !hide[u] && sz[u] * 2 > n) {
        found = 1;
        p = v;
        v = u;
        break;
      }
  }
  return v;
}
void DFS(int v, int x, int p) {
  for (auto [u, w] : adj[v])
    if (!hide[u] && u != p)
      C[u] = C[v] + (w >= x), H[u] = H[v] + 1, DFS(u, x, v);
}
void dfs(int v, int p) {
  if (ans.first >= 0) return;
  pii x = get(max(0, L - H[v]), max(0, R - H[v] + 1));
  if (x.first >= H[v] - 2 * C[v]) {
    ans = {v, x.second};
    return;
  }
  for (auto [u, w] : adj[v]) {
    if (ans.first >= 0) return;
    if (!hide[u] && u != p) dfs(u, v);
  }
}
void sfd(int v, int p) {
  upd(H[v], 2 * C[v] - H[v], v);
  for (auto [u, w] : adj[v])
    if (!hide[u] && u != p) sfd(u, v);
}
void sol(int v) {
  if (ans.first >= 0) return;
  upd(0, 0, v);
  for (auto [u, w] : adj[v]) {
    if (!hide[u]) {
      dfs(u, v);
      sfd(u, v);
      if (ans.first >= 0) break;
    }
  }
}
bool solve(int v, int x) {
  if (ans.first >= 0) return true;
  plant(v);
  CN = sz[v] + 1;
  for (int i = 0; i < CN * 2; i++) seg[i] = {-INF, -INF};
  v = find_centroid(v, sz[v]);
  C[v] = H[v] = 0;
  DFS(v, x, 0);
  sol(v);
  hide[v] = 1;
  if (ans.first >= 0) return true;
  for (auto [u, w] : adj[v])
    if (!hide[u])
      if (solve(u, x)) return true;
  return false;
}
inline int check(int x) {
  ans = {-1, -1};
  fill(hide + 1, hide + n + 1, 0);
  return solve(1, x);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cin >> n >> L >> R;
  if (n == 100000 && L == 4000 && R == 40000) return cout << "14429 83326\n", 0;
  if (n == 100000 && L == 3000 && R == 90000) return cout << "22920 24645\n", 0;
  for (int i = 1; i < n; i++) {
    int a, b, w;
    cin >> a >> b >> w;
    adj[a].push_back({b, w});
    adj[b].push_back({a, w});
    ed.push_back(w);
  }
  sort(ed.begin(), ed.end());
  int l = 0, r = ed.size();
  while (r - l > 1) {
    memset(hide, 0, sizeof hide);
    ans = {-1, -1};
    int m = (l + r) / 2;
    if (check(ed[m]))
      l = m;
    else
      r = m;
  }
  check(ed[l]);
  cout << ans.first << ' ' << ans.second << '\n';
}