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 MAX_N = 222222;
int g[MAX_N], nxt[MAX_N], c[MAX_N], value[MAX_N], ok[MAX_N], nm;
int sc[MAX_N], s[MAX_N], S, root, ss[MAX_N];
int n, L, R;
int m, ansX, ansY, ans, A, B;
int Nb, b[MAX_N];
pair<int, int> xs1[MAX_N], xs2[MAX_N];
int sgl[MAX_N];
int NC, C[MAX_N], D[MAX_N], res[MAX_N];
void addedge(int x, int y, int w) {
  g[nm] = y;
  nxt[nm] = c[x];
  c[x] = nm;
  value[nm] = w;
  ok[nm] = 1;
  nm++;
}
void findroot(int i, int p) {
  s[i] = 1;
  sc[i] = 0;
  for (int k = c[i]; ~k; k = nxt[k]) {
    int j = g[k];
    if (j == p || !ok[k]) continue;
    findroot(j, i);
    s[i] += s[j];
    sc[i] = max(sc[i], s[j]);
  }
  sc[i] = max(sc[i], S - s[i]);
  if (sc[i] < sc[root]) root = i;
}
void findall(int i, int p) {
  for (int k = c[i]; ~k; k = nxt[k]) {
    int j = g[k];
    if (j == p || !ok[k]) continue;
    b[++Nb] = value[k];
    findall(j, i);
  }
}
int maxlen(int i, int p) {
  int mx = 0;
  for (int k = c[i]; ~k; k = nxt[k]) {
    int j = g[k];
    if (j == p || !ok[k]) continue;
    mx = max(mx, maxlen(j, i) + 1);
  }
  return mx;
}
void select(int i, int p, int rs, int dep) {
  if (dep <= R) {
    if (rs > xs2[dep].first) xs2[dep] = make_pair(rs, i);
  }
  for (int k = c[i]; ~k; k = nxt[k]) {
    int j = g[k];
    if (!ok[k] || j == p) continue;
    select(j, i, rs + ((value[k] >= m) ? (1) : (-1)), dep + 1);
  }
}
bool cks(int x) {
  int n1 = 0;
  xs1[0] = make_pair(0, x);
  for (int k = 1; k <= D[C[NC]]; ++k) xs1[k] = make_pair(-1000000000, -1);
  for (int k = 1; k <= NC; ++k) {
    int j = C[k];
    int n2 = D[j];
    for (int i = 1; i <= n2; ++i) xs2[i] = make_pair(-1000000000, -1);
    select(j, x, (value[res[j]] >= m) ? (1) : (-1), 1);
    int p = min(n2, R), l = 1, r = 0;
    for (j = 0; j <= n1; ++j) {
      while (p && p + j >= L) {
        while (l <= r && xs2[p].first >= xs2[sgl[r]].first) --r;
        sgl[++r] = p;
        --p;
      }
      while (l <= r && sgl[l] + j > R) ++l;
      if (l <= r && xs1[j].first + xs2[sgl[l]].first >= 0) {
        A = xs1[j].second, B = xs2[sgl[l]].second;
        return 1;
      }
    }
    for (j = 1; j <= n2; ++j)
      if (xs1[j].first < xs2[j].first) xs1[j] = xs2[j];
    n1 = n2;
  }
  return 0;
}
bool cmp(int x, int y) { return D[x] < D[y]; }
void calc(int x) {
  Nb = 0;
  findall(x, -1);
  sort(b + 1, b + 1 + Nb);
  Nb = unique(b + 1, b + 1 + Nb) - b - 1;
  int l = 0, r = Nb + 1;
  NC = 0;
  for (int k = c[x]; ~k; k = nxt[k]) {
    int j = g[k];
    if (!ok[k]) continue;
    C[++NC] = j;
    res[j] = k;
    D[j] = maxlen(j, x) + 1;
  }
  sort(C + 1, C + 1 + NC, cmp);
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    m = b[mid];
    if (cks(x))
      l = mid;
    else
      r = mid;
  }
  m = b[l];
  cks(x);
  if (m > ans) {
    ans = m;
    ansX = A;
    ansY = B;
  }
  findroot(x, -1);
  for (int k = c[x]; ~k; k = nxt[k]) {
    int j = g[k];
    if (!ok[k]) continue;
    ss[j] = s[j];
  }
  for (int k = c[x]; ~k; k = nxt[k]) {
    int j = g[k];
    if (!ok[k]) continue;
    ok[k ^ 1] = ok[k] = 0;
    S = ss[j];
    root = 0;
    findroot(j, -1);
    calc(root);
  }
}
int main() {
  scanf("%d%d%d", &n, &L, &R);
  memset(c, -1, sizeof c);
  for (int i = 1; i < n; ++i) {
    int x, y, w;
    scanf("%d%d%d", &x, &y, &w);
    addedge(x, y, w);
    addedge(y, x, w);
  }
  ans = -1;
  s[0] = sc[0] = n + 1;
  S = n;
  root = 0;
  findroot(1, -1);
  calc(root);
  cout << ansX << " " << ansY << endl;
}