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>
template <typename T>
inline void ckmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline void ckmin(T& x, T y) {
  x = (y < x ? y : x);
}
using namespace std;
const long long inf = 0x7f7f7f7f;
const double Pi = acos(-1);
const long long mod = 998244353;
const long double eps = 1e-8;
inline long long fpow(long long a, long long b = mod - 2, long long p = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % p;
    a = a * a % p;
    b >>= 1;
  }
  return res;
}
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writesp(long long x) { write(x), putchar(' '); }
inline void writeln(long long x) {
  write(x);
  putchar('\n');
}
const long long N = 4e5 + 10;
long long n, _n, L, R, ansu, ansv;
long long val[N];
long long siz[N];
long long vis[N], cxy = 50;
long long dis[N], dep[N], que[N], fa[N], cnt[N], rev[N], ljt[N];
long long M;
long long g[N], gg[N];
vector<pair<long long, long long> > e[N];
long long bfs(long long G) {
  long long st = 1, en = 0;
  que[++en] = G;
  fa[G] = 0;
  for (; st <= en; st++) {
    long long u = que[st];
    for (auto qwq : e[u]) {
      long long v = qwq.first;
      if (vis[v] == cxy) continue;
      if (v != fa[u])
        fa[v] = u, que[++en] = v, dep[v] = dep[u] + 1,
        cnt[v] = cnt[u] + (qwq.second < val[M] ? -1 : 1);
    }
  }
  return en;
}
long long find_gra(long long G) {
  long long Mn = inf, Mnpos;
  long long en = bfs(G);
  for (long long t = (en), tE = (1); t >= tE; t--) {
    long long u = que[t];
    long long mx = 0;
    siz[u] = 1;
    for (auto qwq : e[u]) {
      long long v = qwq.first;
      if (vis[v] == cxy || v == fa[u]) continue;
      siz[u] += siz[v];
      ckmax(mx, siz[v]);
    }
    ckmax(mx, en - siz[u]);
    if (mx < Mn) Mn = mx, Mnpos = u;
  }
  return Mnpos;
}
long long calc(long long u) {
  long long en = bfs(u);
  for (long long i = (1), iE = (en); i <= iE; i++)
    if (rev[dep[que[i]]] < cnt[que[i]])
      rev[dep[que[i]]] = cnt[que[i]], gg[dep[que[i]]] = que[i];
  long long ok = 0, bg = 1, ed = 0;
  for (long long i = en, j = 0; i; i--) {
    long long ql = L - i, qr = R - i;
    if (ql > _n) break;
    ckmax(j, ql);
    for (; j <= qr && j <= _n; j++) {
      for (; bg <= ed && dis[j] > dis[ljt[ed]]; ed--)
        ;
      ljt[++ed] = j;
    }
    for (; bg <= ed && ljt[bg] < ql; bg++)
      ;
    if (bg <= ed && dis[ljt[bg]] + rev[i] >= 0) {
      ansu = g[ljt[bg]], ansv = gg[i], ok = 1;
      break;
    }
  }
  _n = max(_n, en);
  for (long long i = (1), iE = (en); i <= iE; i++) {
    if (rev[i] > dis[i]) dis[i] = rev[i], g[i] = gg[i];
    rev[i] = -inf;
  }
  return ok;
}
long long solve(long long u) {
  long long G = find_gra(u);
  dep[G] = cnt[G] = 0;
  long long en = bfs(G);
  vis[G] = cxy;
  dis[0] = _n = 0;
  g[0] = G;
  for (long long i = (1), iE = (en); i <= iE; i++) dis[i] = rev[i] = -inf;
  for (auto qwq : e[G]) {
    long long v = qwq.first;
    if (vis[v] == cxy) continue;
    if (calc(v)) return 1;
  }
  for (auto qwq : e[G]) {
    long long v = qwq.first;
    if (vis[v] == cxy) continue;
    if (solve(v)) return 1;
  }
  return 0;
}
inline long long check() { return solve(1); }
signed main() {
  n = read(), L = read(), R = read();
  for (long long i = (1), iE = (n - 1); i <= iE; i++) {
    long long u = read(), v = read();
    val[i] = read();
    e[u].push_back(make_pair(v, val[i])), e[v].push_back(make_pair(u, val[i]));
  }
  sort(val + 1, val + n);
  long long l = 1, r = n - 1;
  while (l <= r) {
    M = (l + r) >> 1;
    cxy--;
    if (check())
      l = M + 1;
    else
      r = M - 1;
  }
  M = r;
  cxy--;
  check();
  printf("%lld %lld\n", ansu, ansv);
}