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;
inline int rd() {
  int x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    x = x * 10 + (c ^ 48);
    c = getchar();
  }
  return x;
}
int n, m, L, R, U, tot, hd[100005], c[100005];
struct edge {
  int to, nxt, c, w;
} e[100005 << 1];
inline void add(int u, int v, int c) {
  e[++tot].to = v;
  e[tot].c = c;
  e[tot].nxt = hd[u];
  hd[u] = tot;
}
bool vis[100005];
int mx, totn, rt, dis[100005], sz[100005];
void getrt(int u, int fa) {
  sz[u] = 1;
  int mxs = 0;
  for (int i = hd[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa && !vis[v]) {
      getrt(v, u);
      sz[u] += sz[v];
      mxs = max(mxs, sz[v]);
    }
  mxs = max(mxs, totn - sz[u]);
  if (mxs < mx) {
    mx = mxs;
    rt = u;
  }
}
void getsz(int u, int fa) {
  sz[u] = 1;
  for (int i = hd[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa && !vis[v]) {
      getsz(v, u);
      sz[u] += sz[v];
    }
}
int mxd[100005], s[100005];
int getdep(int u, int fa, int dep) {
  int resd = dep;
  for (int i = hd[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa && !vis[v]) resd = max(resd, getdep(v, u, dep + 1));
  return resd;
}
inline bool cmp(int x, int y) { return mxd[x] < mxd[y]; }
int bkt[100005], bktson[100005], val[100005], id[100005];
void dfs(int u, int fa, int sum, int dep) {
  if (sum > bktson[dep]) {
    bktson[dep] = sum;
    id[dep] = u;
  }
  for (int i = hd[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa && !vis[v]) dfs(v, u, sum + e[i].w, dep + 1);
}
int q[100005], ql, qr, ptr;
bool divide(int u) {
  vis[u] = 1;
  s[0] = 0;
  for (int i = hd[u], v; i; i = e[i].nxt)
    if (!vis[v = e[i].to]) {
      s[++s[0]] = v;
      val[v] = e[i].w;
      mxd[v] = getdep(v, u, 1);
    }
  bkt[0] = 0;
  sort(s + 1, s + 1 + s[0], cmp);
  for (int i = 1; i <= mxd[s[s[0]]]; ++i) bkt[i] = -1000000000;
  for (int i = 1, v; i <= s[0]; ++i) {
    v = s[i];
    for (int j = 0; j <= mxd[v]; ++j) bktson[j] = id[i] = -1000000000;
    dfs(v, u, val[v], 1);
    ql = 1;
    qr = 0;
    ptr = 0;
    for (int j = mxd[v], l, r; j; --j) {
      l = max(1, L - j);
      r = min(mxd[v], R - j);
      if (L <= j && j <= R && bktson[j] >= 0) {
        U = id[j];
        return 1;
      }
      if (l <= r) {
        while (ptr + 1 <= r) {
          ++ptr;
          while (ql <= qr && bkt[q[qr]] <= bkt[ptr]) --qr;
          q[++qr] = ptr;
        }
        while (ql <= qr && q[ql] < l) ++ql;
        if (ql <= qr && bktson[j] + bkt[q[ql]] >= 0) {
          U = id[j];
          return 1;
        }
      }
    }
    for (int j = 0; j <= mxd[v]; ++j) bkt[j] = max(bkt[j], bktson[j]);
  }
  for (int i = hd[u], v; i; i = e[i].nxt)
    if (!vis[v = e[i].to]) {
      getsz(v, u);
      totn = mx = sz[v];
      rt = v;
      getrt(v, 0);
      if (divide(rt)) return 1;
    }
  return 0;
}
inline bool valid(int mid) {
  for (int i = 1; i <= tot; ++i) e[i].w = (e[i].c >= mid ? 1 : -1);
  U = 1000000000;
  mx = totn = n;
  for (int i = 0; i <= n; ++i) vis[i] = 0;
  getrt(1, 0);
  return divide(rt);
}
bool getchain(int u, int fa, int sum, int dep) {
  if (sum >= 0 && dep >= L && dep <= R) {
    printf("%d\n", u);
    return 1;
  }
  for (int i = hd[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa)
      if (getchain(v, u, sum + e[i].w, dep + 1)) return 1;
  return 0;
}
int main() {
  n = rd();
  L = rd();
  R = rd();
  for (int i = 1, u, v; i < n; ++i) {
    u = rd();
    v = rd();
    c[++c[0]] = rd();
    add(u, v, c[c[0]]);
    add(v, u, c[c[0]]);
  }
  sort(c + 1, c + 1 + c[0]);
  c[0] = unique(c + 1, c + 1 + c[0]) - c - 1;
  int l = 1, r = c[0], mid, u;
  while (l < r) {
    mid = ((l + r + 1) >> 1);
    valid(c[mid]) ? l = mid : r = mid - 1;
  }
  int ans = c[l];
  valid(c[l]);
  u = U;
  for (int i = 1; i <= tot; ++i) e[i].w = (e[i].c >= ans ? 1 : -1);
  printf("%d ", u);
  getchain(u, 0, 0, 0);
  return 0;
}