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 = 2e5 + 5, LOG = 18;
int n, l, r, T, PEDY;
int ansV, ansU;
pair<pair<int, int>, int> edge[N];
vector<pair<int, int> > G[N];
int num, cen;
int down[N];
bool del[N];
int mark[N];
int val[N];
int deep[N];
int type[N];
int Arr[N], P;
int vec[N], L, R;
vector<int> VAL;
void refresh() {
  for (int i = 0; i < n; i++) G[i].clear();
  for (int i = 0; i < n; i++) {
    del[i] = false;
    mark[i] = -1;
  }
}
int calc(int v, int par = -1) {
  mark[v] = T;
  down[v] = 1;
  for (pair<int, int> u : G[v])
    if (u.first != par && !del[u.first]) down[v] += calc(u.first, v);
  return down[v];
}
int find_cen(int v, int par = -1) {
  for (pair<int, int> u : G[v])
    if (u.first != par && !del[u.first])
      if (down[u.first] * 2 > num) return find_cen(u.first, v);
  return v;
}
void make_tree(int d) {
  refresh();
  for (int i = 0; i < n - 1; i++) {
    G[edge[i].first.first].push_back(
        {edge[i].first.second, (edge[i].second >= d ? +1 : -1)});
    G[edge[i].first.second].push_back(
        {edge[i].first.first, (edge[i].second >= d ? +1 : -1)});
  }
}
void dfs(int v, int par = cen) {
  if (v == cen)
    deep[v] = val[v] = 0;
  else {
    deep[v] = 1 + deep[par];
    type[v] = (par == cen ? v : type[par]);
  }
  if (v != cen)
    if (Arr[deep[v]] == -1 || val[v] > val[Arr[deep[v]]]) Arr[deep[v]] = v;
  for (pair<int, int> u : G[v])
    if (u.first != par && !del[u.first]) {
      val[u.first] = u.second + val[v];
      dfs(u.first, v);
    }
}
bool check(int v, int par) {
  if (r < deep[v]) return false;
  if (l <= deep[v] && 0 <= val[v]) {
    ansV = cen;
    ansU = v;
    return true;
  }
  int len = r - deep[v];
  if (P <= len) len = max(len, r - l + 1);
  if (Arr[len] != -1 && 0 <= val[Arr[len]] + val[v] &&
      type[Arr[len]] != type[v]) {
    ansV = Arr[len];
    ansU = v;
    return true;
  }
  for (pair<int, int> u : G[v])
    if (u.first != par && !del[u.first])
      if (check(u.first, v)) return true;
  return false;
}
void make() {
  P = 1;
  while (Arr[P] != -1) P++;
  L = R = 0;
  for (int i = 1; i < P; i++) {
    while (L < R && val[vec[R - 1]] <= val[Arr[i]]) R--;
    vec[R++] = Arr[i];
    while (L < R && deep[vec[L]] + r - l < i) L++;
    Arr[i] = vec[L];
  }
  if (P <= r - l + 1)
    for (int i = r - l + 1; i < r - l + P; i++) {
      while (L < R && deep[vec[L]] + r - l < i) L++;
      if (L == R) break;
      Arr[i] = vec[L];
    }
  else {
    for (int i = P;; i++) {
      while (L < R && deep[vec[L]] + r - l < i) L++;
      if (L == R) break;
      Arr[i] = vec[L];
    }
  }
}
bool can(int d) {
  make_tree(d);
  int DEL = 0;
  for (T = 0; DEL < n; T++) {
    for (int i = 0; i < n; i++)
      if (mark[i] != T && !del[i]) {
        num = calc(i);
        cen = find_cen(i);
        for (int j = 1; j < P; j++) Arr[j] = -1;
        if (P <= r - l + 1)
          for (int i = r - l + 1; i < r - l + P; i++) Arr[i] = -1;
        else
          for (int i = P; Arr[i] != -1; i++) Arr[i] = -1;
        dfs(cen);
        make();
        for (pair<int, int> u : G[cen])
          if (!del[u.first])
            if (check(u.first, cen)) return true;
        del[cen] = true;
        DEL++;
      }
  }
  return false;
}
int DFS(int v, int par = -1) {
  if (v == ansU) return 0;
  int ans = N + N;
  for (pair<int, int> u : G[v])
    if (u.first != par) ans = min(ans, 1 + DFS(u.first, v));
  return ans;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  fill(Arr, Arr + N, -1);
  cin >> n >> l >> r;
  for (int i = 0; i < n - 1; i++) {
    int v, u, w;
    cin >> v >> u >> w;
    v--, u--;
    edge[i] = {{v, u}, w};
    VAL.push_back(w);
  }
  sort(VAL.begin(), VAL.end());
  VAL.resize(unique(VAL.begin(), VAL.end()) - VAL.begin());
  int s = 0, e = VAL.size();
  while (e - s > 1) {
    int mid = (e + s) >> 1;
    if (can(VAL[mid]))
      s = mid;
    else
      e = mid;
  }
  can(VAL[s]);
  cout << ansV + 1 << " " << ansU + 1 << "\n";
  return 0;
}