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;
inline int read() {
  int res = 0;
  int neg;
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9' || ch == '-') {
      if (ch == '-')
        neg = -1;
      else
        neg = 1, res = ch - '0';
      break;
    }
  }
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9')
      res *= 10, res += ch - '0';
    else
      break;
  }
  return res * neg;
}
const int maxn = 100020;
const int MOd = 1e7;
int a, L, R, st[maxn], at;
bool flag, used[maxn];
vector<pair<int, pair<int, int> > > w[maxn];
vector<pair<int, int> > w2[maxn];
int dfs(int n, int back, int sz) {
  int ret = 1;
  st[++at] = n;
  for (int i = 0; i < w[n].size(); i++)
    if (w[n][i].first != back && !used[w[n][i].first]) {
      int t = dfs(w[n][i].first, n, sz);
      w[n][i].second.second = t;
      ret += t;
    }
  for (int i = 0; i < w[n].size(); i++)
    if (w[n][i].first == back) w[n][i].second.second = sz - ret;
  return ret;
}
vector<int> Cw[maxn];
int ans1, ans2, sz[maxn];
void center(int n, int back, int szz) {
  at = 0;
  dfs(n, 0, szz);
  int C = n;
  for (int i = 1; i <= at; i++) {
    int t = st[i];
    int c = 0;
    for (int j = 0; j < w[t].size(); j++)
      if (w[t][j].second.second > szz / 2) {
        c = 1;
        break;
      }
    if (!c) C = t;
  }
  Cw[back].push_back(C);
  sz[C] = szz;
  used[C] = 1;
  for (int i = 0; i < w[C].size(); i++)
    if (!used[w[C][i].first]) center(w[C][i].first, C, w[C][i].second.second);
}
int N, T;
pair<int, int> segment[maxn * 3];
pair<int, pair<int, int> > st2[maxn];
void dfss(int &n, int &back, int der, int s) {
  st2[++at].first = n;
  st2[at].second.first = der;
  st2[at].second.second = s + s - der;
  pair<int, int> t;
  t.first = -1e9;
  t.second = 0;
  int l = L - der, r = R - der;
  if (l < N && 0 <= l) {
    if (r > N - 1) r = N - 1;
    for (l += N, r += N; l <= r; l = (l + 1) >> 1, r = (r - 1) >> 1) {
      if (l & 1) t = max(t, (segment[l]));
      if (~r & 1) t = max(t, (segment[r]));
    }
  }
  if (t.first + s + s - der >= 0) {
    ans1 = n;
    ans2 = t.second;
    flag = 1;
    return;
  }
  for (int i = 0; i < w2[n].size() && !flag; i++)
    if (w2[n][i].first != back && !used[w2[n][i].first])
      dfss(w2[n][i].first, n, der + 1, s + w2[n][i].second);
}
void calc(int &C) {
  N = 1;
  while (N < sz[C]) N <<= 1;
  for (int i = 1; i < N + N; i++) segment[i] = pair<int, int>(-1e9, 0);
  for (int k = N; k; k >>= 1) segment[k] = pair<int, int>(0, C);
  for (int i = 0; i < w2[C].size(); i++)
    if (!used[w2[C][i].first]) {
      at = 0;
      dfss(w2[C][i].first, C, 1, w2[C][i].second);
      if (flag) return;
      for (int i = 1; i <= at; i++) {
        pair<int, pair<int, int> > &t = st2[i];
        int k = t.second.first + N;
        if (segment[k].first < t.second.second) {
          segment[k] = pair<int, int>(t.second.second, t.first);
          for (k >>= 1; k; k >>= 1)
            segment[k] = max(segment[k + k], segment[k + k + 1]);
        }
      }
    }
  used[C] = 1;
  for (int i = 0; i < Cw[C].size(); i++) {
    calc(Cw[C][i]);
    if (flag) return;
  }
}
bool f(int n) {
  for (int i = 1; i <= a; i++)
    for (int j = 0; j < w[i].size(); j++)
      w2[i][j].second = (w[i][j].second.first >= n);
  flag = 0;
  memset(used, 0, sizeof(used));
  calc(Cw[0][0]);
  return flag;
}
int main() {
  scanf("%d %d %d", &a, &L, &R);
  for (int i = 1, j, k, t; i < a; i++) {
    scanf("%d %d %d", &j, &k, &t);
    w[j].push_back(pair<int, pair<int, int> >(k, pair<int, int>(t, 0)));
    w[k].push_back(pair<int, pair<int, int> >(j, pair<int, int>(t, 0)));
    w2[j].push_back(pair<int, int>(k, 0));
    w2[k].push_back(pair<int, int>(j, 0));
  }
  center(1, 0, a);
  int t = -1;
  for (int k = 29; k >= 0; k--)
    if (f(t + (1 << k))) t += 1 << k;
  printf("%d %d\n", ans1, ans2);
  return 0;
}