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;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
vector<pair<int, int> > adj[100100];
int n, L, R;
struct RMQ_Tree {
  int n;
  pair<int, int> mx[8 * 100100];
  void init(int _n) {
    for (n = 1; n < _n; n <<= 1)
      ;
    for (int i = 1; i < 4 * n; i++) mx[i] = pair<int, int>(-0x3f3f3f3f, 0);
  }
  void insert(int p, pair<int, int> val) {
    p += n + 1;
    for (; p >= 1 && val > mx[p]; p >>= 1) mx[p] = val;
  }
  pair<int, int> calc(int st, int ed) {
    if (st > ed) return pair<int, int>(-0x3f3f3f3f, 0);
    st += n;
    ed += n + 2;
    pair<int, int> ans = pair<int, int>(-0x3f3f3f3f, 0);
    while (st ^ ed ^ 1) {
      if (~st & 1) smax(ans, mx[st ^ 1]);
      if (ed & 1) smax(ans, mx[ed ^ 1]);
      st >>= 1;
      ed >>= 1;
    }
    return ans;
  }
} Tree;
int qf, qb, q[100100], sz[100100], fa[100100];
int nn, vst[100100], id[100100], dis[100100], val[100100], mid;
int ans, S, T;
int find_root(int u) {
  qf = qb = 0;
  q[qb++] = u;
  fa[u] = 0;
  while (qf < qb) {
    u = q[qf++];
    for (int i = adj[u].size(); i--;) {
      int v = adj[u][i].first;
      if (v == fa[u] || vst[v]) continue;
      fa[v] = u;
      q[qb++] = v;
    }
  }
  nn = qb;
  for (int i = nn; i--;) {
    sz[u = q[i]] = 1;
    int mx = 0;
    for (int j = adj[u].size(); j--;) {
      int v = adj[u][j].first;
      if (v == fa[u] || vst[v]) continue;
      smax(mx, sz[v]);
      sz[u] += sz[v];
    }
    if (mx * 2 <= nn && sz[u] * 2 >= nn) return u;
  }
}
void dfs(int u, int p, int d, int pv) {
  id[nn] = u;
  dis[nn] = d;
  val[nn] = pv;
  nn++;
  for (int i = adj[u].size(); i--;) {
    int v = adj[u][i].first;
    if (v == p || vst[v]) continue;
    int w = adj[u][i].second;
    dfs(v, u, d + 1, pv + (w >= mid ? 1 : -1));
  }
}
bool check(int u, int mx_dp) {
  Tree.init(mx_dp);
  Tree.insert(0, pair<int, int>(0, u));
  for (int i = adj[u].size(); i--;) {
    int v = adj[u][i].first;
    if (vst[v]) continue;
    int w = adj[u][i].second;
    nn = 0;
    dfs(v, u, 1, (w >= mid ? 1 : -1));
    for (int i = 0; i < nn; i++) {
      pair<int, int> mx = Tree.calc(max(L - dis[i], 0), min(R - dis[i], mx_dp));
      if (val[i] + mx.first >= 0) {
        ans = mid;
        S = id[i];
        T = mx.second;
        return true;
      }
    }
    for (int i = 0; i < nn; i++) {
      Tree.insert(dis[i], pair<int, int>(val[i], id[i]));
    }
  }
  return false;
}
void solve(int u) {
  u = find_root(u);
  vst[u] = 1;
  nn = 0;
  dfs(u, 0, 0, 0);
  int st = ans, ed = 0x3f3f3f3f;
  int mx_dp = *max_element(dis, dis + nn);
  while (ed - st > 1) {
    mid = st + ed >> 1;
    if (check(u, mx_dp))
      st = mid;
    else
      ed = mid;
  }
  for (int i = adj[u].size(); i--;) {
    int v = adj[u][i].first;
    if (!vst[v]) solve(v);
  }
}
int main() {
  cin >> n >> L >> R;
  int u, v, w;
  for (int i = 1; i < n; i++) {
    scanf("%d %d %d", &u, &v, &w);
    adj[u].push_back(pair<int, int>(v, w));
    adj[v].push_back(pair<int, int>(u, w));
  }
  ans = -1;
  solve(1);
  printf("%d %d\n", S, T);
  return 0;
}