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 = 100005;
const int INF = 2147483647;
struct EDGE {
  int to, len, c;
};
int n, L, R, A[N], B[N], C[N];
int cvc, vc[N];
vector<EDGE> g[N];
int ans1, ans2;
int maxdep, subtree_size[N], dep[N], sum[N];
int cvs, vs[N], endid[N];
bool centroid[N];
int pw2, zkw[N * 4];
void initzkw(int sz) {
  for (pw2 = 1; pw2 < sz; pw2 <<= 1)
    ;
  for (int i = 1; i < (pw2 << 1); i++) zkw[i] = 0;
}
void update(int i, int u) {
  int val = sum[u];
  for (i += pw2; i > 0; i >>= 1)
    if (val > sum[zkw[i]]) zkw[i] = u;
}
int query(int l, int r) {
  int ans = 0;
  for (l += pw2, r += pw2; l < r; l >>= 1, r >>= 1) {
    if (l & 1) {
      if (sum[zkw[l]] > sum[ans]) ans = zkw[l];
      l++;
    }
    if (r & 1) {
      r--;
      if (sum[zkw[r]] > sum[ans]) ans = zkw[r];
    }
  }
  return ans;
}
int compute_subtree_size(int u, int lst) {
  subtree_size[u] = 1;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i].to;
    if (v == lst || centroid[v]) continue;
    subtree_size[u] += compute_subtree_size(v, u);
  }
  return subtree_size[u];
}
pair<int, int> get_centroid(int u, int lst, int sz) {
  pair<int, int> res = make_pair(INF, 0);
  int sm = 1, mx = 0;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i].to;
    if (v == lst || centroid[v]) continue;
    res = min(res, get_centroid(v, u, sz));
    mx = max(mx, subtree_size[v]);
    sm += subtree_size[v];
  }
  mx = max(mx, sz - sm);
  res = min(res, make_pair(mx, u));
  return res;
}
void initdfs(int u, int lst, int lim, int D) {
  dep[u] = D;
  maxdep = max(maxdep, D);
  vs[++cvs] = u;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i].to;
    if (v == lst || centroid[v]) continue;
    if (g[u][i].c < lim)
      sum[v] = sum[u] - 1;
    else
      sum[v] = sum[u] + 1;
    initdfs(v, u, lim, D + 1);
  }
  endid[u] = cvs;
}
bool solve(int u, int lim) {
  compute_subtree_size(u, 0);
  int s = get_centroid(u, 0, subtree_size[u]).second;
  centroid[s] = true;
  for (int i = 0; i < g[s].size(); i++) {
    int v = g[s][i].to;
    if (centroid[v]) continue;
    if (solve(v, lim)) return true;
  }
  maxdep = 0;
  sum[s] = 0;
  cvs = 0;
  initdfs(s, 0, lim, 0);
  initzkw(maxdep + 1);
  update(dep[s], s);
  for (int i = 2, j; i <= cvs; i = endid[vs[i]] + 1) {
    for (j = i; j <= endid[vs[i]]; j++) {
      int u = vs[j];
      int rL = max(0, L - dep[u]), rR = min(maxdep, R - dep[u]);
      if (rR < 0) continue;
      rR++;
      int v = query(rL, rR);
      if (!v) continue;
      if (sum[u] + sum[v] >= 0) {
        ans1 = u, ans2 = v;
        return true;
      }
    }
    for (j = i; j <= endid[vs[i]]; j++) {
      int u = vs[j];
      update(dep[u], u);
    }
  }
  centroid[s] = false;
  return false;
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &A[i], &B[i], &C[i]);
    vc[cvc++] = C[i];
  }
  sort(vc, vc + cvc);
  cvc = unique(vc, vc + cvc) - vc;
  EDGE ztr;
  for (int i = 1; i < n; i++) {
    C[i] = lower_bound(vc, vc + cvc, C[i]) - vc + 1;
    ztr.c = C[i];
    ztr.to = B[i];
    g[A[i]].push_back(ztr);
    ztr.to = A[i];
    g[B[i]].push_back(ztr);
  }
  int lo, hi, mid;
  lo = 1;
  hi = cvc;
  sum[0] = -INF;
  while (lo < hi) {
    mid = (lo + hi + 1) >> 1;
    ans1 = ans2 = 0;
    memset(centroid, false, sizeof(centroid));
    if (solve(1, mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  solve(1, lo);
  printf("%d %d\n", ans1, ans2);
  return 0;
}