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 = 2e5 + 10, inf = 0x3f3f3f3f;
int h[N], cnt, nxt[N], to[N], e[N], siz[N], w[N];
int n, m, L, R, a, b, c, ts, rs, rt, vis[N], s[N];
int ans, ansu, ansv;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int in() {
  int x = 0;
  char ch = nc();
  while (ch < '0' || ch > '9') ch = nc();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = nc();
  return x;
}
void add(int u, int v, int w) {
  ++cnt;
  nxt[cnt] = h[u];
  h[u] = cnt;
  to[cnt] = v;
  e[cnt] = w;
}
void getrt(int u, int fa) {
  int ns = 0;
  siz[u] = 1;
  for (int i = h[u]; i; i = nxt[i]) {
    int v = to[i];
    if (v == fa || vis[v]) continue;
    getrt(v, u);
    siz[u] += siz[v];
    if (siz[v] > ns) ns = siz[v];
  }
  if (ts - siz[u] > ns) ns = ts - siz[u];
  if (rs > ns) rs = ns, rt = u;
}
int cu, cv, q[N], sq[N], qu[N], squ[N], ld, nd;
int tmp[N], tmpu[N], mid, top;
void dfs(int u, int fa, int d, int x) {
  if (tmp[d] < x) tmp[d] = x, tmpu[d] = u;
  if (nd < d) nd = d;
  for (int i = h[u]; i; i = nxt[i]) {
    int v = to[i];
    if (v == fa || vis[v]) continue;
    if (e[i] >= w[mid])
      dfs(v, u, d + 1, x + 1);
    else
      dfs(v, u, d + 1, x - 1);
  }
}
bool check(int u) {
  ld = 0;
  sq[0] = 0;
  squ[0] = u;
  for (int i = 1; i <= top; ++i) {
    int v = to[s[i]];
    for (int j = 1; j <= siz[v]; ++j) tmp[j] = -inf;
    nd = 0;
    if (e[s[i]] >= w[mid])
      dfs(v, u, 1, 1);
    else
      dfs(v, u, 1, -1);
    int l = 1, r = 0, lb = ld, rb = ld + 1;
    for (int j = 1; j <= nd; ++j) {
      while (rb > 0 && rb > L - j) {
        --rb;
        while (l <= r && sq[q[r]] < sq[rb]) --r;
        q[++r] = rb;
      }
      while (lb >= 0 && lb > R - j) {
        --lb;
        while (l <= r && q[l] > lb) ++l;
      }
      if (l <= r && sq[q[l]] + tmp[j] >= 0) {
        cu = squ[q[l]];
        cv = tmpu[j];
        return 1;
      }
    }
    while (ld < nd) sq[++ld] = -inf;
    for (int j = 1; j <= nd; ++j)
      if (sq[j] < tmp[j]) sq[j] = tmp[j], squ[j] = tmpu[j];
  }
  return 0;
}
bool cmp(int a, int b) { return siz[to[a]] < siz[to[b]]; }
void solve(int u) {
  int ns = ts;
  top = 0;
  for (int i = h[u]; i; i = nxt[i]) {
    int v = to[i];
    if (vis[v]) continue;
    if (siz[v] > siz[u]) siz[v] = ns - siz[u];
    s[++top] = i;
  }
  sort(s + 1, s + 1 + top, cmp);
  int l = 1, r = m, now = 0, nu, nv;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(u))
      l = mid + 1, now = mid, nu = cu, nv = cv;
    else
      r = mid - 1;
  }
  if (now > ans) ans = now, ansu = nu, ansv = nv;
  vis[u] = 1;
  for (int i = h[u]; i; i = nxt[i]) {
    int v = to[i];
    if (vis[v]) continue;
    rs = ts = siz[v];
    getrt(v, 0);
    solve(rt);
  }
}
int main() {
  n = in();
  L = in();
  R = in();
  for (int i = 1; i < n; ++i) {
    a = in();
    b = in();
    c = in();
    add(a, b, c);
    add(b, a, c);
    w[i] = c;
  }
  rs = ts = n;
  sort(w + 1, w + n);
  m = unique(w + 1, w + n) - w - 1;
  getrt(1, 0);
  solve(rt);
  printf("%d %d\n", ansu, ansv);
  return 0;
}