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;
int n, L, R;
int len[100005];
vector<pair<int, int> > adj[100005];
pair<int, int> ans, current;
int numChild[100005], total, centre;
int maxVal[4 * 100005], maxPos[4 * 100005];
bool process[100005];
void firstDFS(int u, int pre, int sign) {
  numChild[u] = 1;
  bool found = true;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i].first;
    if (v == pre || process[v]) continue;
    firstDFS(v, u, sign);
    numChild[u] += numChild[v];
    if (sign && numChild[v] > total / 2) found = false;
  }
  if (sign && total - numChild[u] > total / 2) found = false;
  if (sign && found) centre = u;
}
int findCentre(int start, int pre) {
  firstDFS(start, pre, 0);
  total = numChild[start];
  firstDFS(start, pre, 1);
  return centre;
}
void rebuild(int i, int low, int high) {
  if (low == high) {
    maxVal[i] = (low) ? -n : 0;
    maxPos[i] = centre;
    return;
  }
  int mid = (low + high) / 2;
  rebuild(2 * i, low, mid);
  rebuild(2 * i + 1, mid + 1, high);
  maxVal[i] = (low) ? -n : 0;
  maxPos[i] = centre;
}
void update(int i, int low, int high, int pos, int val, int vertex) {
  if (low == high) {
    if (maxVal[i] < val) {
      maxVal[i] = val;
      maxPos[i] = vertex;
    }
    return;
  }
  int mid = (low + high) / 2;
  if (pos <= mid)
    update(2 * i, low, mid, pos, val, vertex);
  else
    update(2 * i + 1, mid + 1, high, pos, val, vertex);
  if (maxVal[2 * i] > maxVal[2 * i + 1])
    maxVal[i] = maxVal[2 * i], maxPos[i] = maxPos[2 * i];
  else
    maxVal[i] = maxVal[2 * i + 1], maxPos[i] = maxPos[2 * i + 1];
}
pair<int, int> getAnswer(int i, int low, int high, int u, int v) {
  if (v < low || high < u) return make_pair(-n, -1);
  if (u <= low && high <= v) return make_pair(maxVal[i], maxPos[i]);
  int mid = (low + high) / 2;
  pair<int, int> g1 = getAnswer(2 * i, low, mid, u, v);
  pair<int, int> g2 = getAnswer(2 * i + 1, mid + 1, high, u, v);
  return (g1.first > g2.first) ? g1 : g2;
}
void secondDFS(int u, int pre, int path, int eval, int lower, int sign) {
  if (current.first >= 0) return;
  if (path > R) return;
  if (!sign) {
    pair<int, int> store = getAnswer(1, 0, total, max(L - path, 0), R - path);
    if (eval + store.first >= 0) current = make_pair(u, store.second);
  }
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i].first;
    if (v == pre || process[v]) continue;
    int delta = (adj[u][i].second >= lower) ? 1 : -1;
    secondDFS(v, u, path + 1, eval + delta, lower, sign);
  }
  if (sign) update(1, 0, total, path, eval, u);
}
void book(int u, int lower) {
  rebuild(1, 0, total);
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i].first, eval = (adj[u][i].second >= lower) ? 1 : -1;
    if (process[v]) continue;
    secondDFS(v, u, 1, eval, lower, 0);
    secondDFS(v, u, 1, eval, lower, 1);
  }
}
void recurse(int start, int pre, int lower) {
  if (current.first >= 0) return;
  int u = findCentre(start, pre);
  process[u] = true;
  if (total < L) return;
  book(u, lower);
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i].first;
    if (!process[v]) recurse(v, u, lower);
  }
}
bool checker(int lower) {
  memset(process, false, sizeof(process));
  current = make_pair(-1, -1);
  recurse(0, -1, lower);
  if (current.first >= 0) ans = current;
  return (current.first >= 0);
}
int main() {
  scanf("%d %d %d", &n, &L, &R);
  for (int i = 0; i + 1 < n; i++) {
    int u, v;
    scanf("%d %d %d", &u, &v, &len[i]);
    u--;
    v--;
    adj[u].push_back(make_pair(v, len[i]));
    adj[v].push_back(make_pair(u, len[i]));
  }
  sort(len, len + n - 1);
  int idxlow = 0, idxhigh = n - 2;
  while (idxlow <= idxhigh) {
    int mid = (idxlow + idxhigh) / 2;
    if (checker(len[mid]))
      idxlow = mid + 1;
    else
      idxhigh = mid - 1;
  }
  printf("%d %d\n", ans.first + 1, ans.second + 1);
}