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 maxn = 100003;
int n, L, U, Link[maxn], t[maxn * 2], v[maxn * 2], pre[maxn * 2],
    tot = 0, lim = 0, s[maxn], tp[maxn], size[maxn];
bool vis[maxn];
int f[maxn], g[maxn], ans, len[maxn], F[maxn], G[maxn], st, ed, S, T;
struct data {
  int t, depth;
} Q[maxn];
int get() {
  int f = 0, v = 0;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') break;
  if (ch == '-')
    f = 1;
  else
    v = ch - 48;
  while (isdigit(ch = getchar())) v = v * 10 + ch - 48;
  if (f == 1)
    return -v;
  else
    return v;
}
int findroot(int x) {
  int front = 0, rear = 1;
  s[front] = x, vis[x] = 1;
  while (front != rear) {
    int p = s[front];
    for (int i = Link[p]; i > 0; i = pre[i])
      if (!vis[t[i]]) s[rear++] = t[i], vis[t[i]] = 1;
    front++;
  }
  if (rear <= L) return -1;
  int root, tp, m = n;
  for (int i = rear - 1; i >= 0; i--) {
    tp = vis[s[i]] = 0;
    size[s[i]] = 1;
    for (int j = Link[s[i]]; j > 0; j = pre[j])
      if (!vis[t[j]]) {
        size[s[i]] += size[t[j]];
        if (tp == 0 || size[tp] < size[t[j]]) tp = t[j];
      }
    tp = max(size[tp], rear - size[s[i]]);
    if (tp < m) m = tp, root = s[i];
  }
  return root;
}
int getmaxdepth(int x) {
  int front = 0, rear = 1, res = 1;
  s[front] = x, tp[front] = 1;
  vis[x] = 1;
  while (front != rear) {
    int p = s[front];
    if (tp[front] == U) break;
    for (int i = Link[p]; i > 0; i = pre[i])
      if (!vis[t[i]]) {
        vis[t[i]] = 1;
        tp[rear] = tp[front] + 1, s[rear++] = t[i];
        res = max(res, tp[rear - 1]);
      }
    front++;
  }
  for (int i = rear - 1; i >= 0; i--) vis[s[i]] = 0;
  return res;
}
int check(int N, int delta) {
  int maxd = 0;
  f[0] = 0;
  int res = -2000000000;
  for (int i = 1; i <= N; i++) {
    int x = t[Q[i].t], front = 0, rear = 1, maxd0 = 1;
    s[front] = x, tp[front] = 1;
    len[front] = g[1] = (v[Q[i].t] - delta) >= 0 ? 1 : -1;
    G[1] = x;
    vis[x] = 1;
    while (front != rear) {
      int p = s[front];
      if (tp[front] == U) break;
      for (int j = Link[p]; j > 0; j = pre[j]) {
        if (vis[t[j]]) continue;
        vis[t[j]] = 1;
        tp[rear] = tp[front] + 1;
        len[rear] = len[front] + ((v[j] - delta) >= 0 ? 1 : -1);
        if (tp[rear] > maxd0)
          g[tp[rear]] = len[rear], G[tp[rear]] = t[j], maxd0 = tp[rear];
        else if (len[rear] > g[tp[rear]])
          g[tp[rear]] = len[rear], G[tp[rear]] = t[j];
        s[rear++] = t[j];
      }
      front++;
    }
    for (int i = rear - 1; i >= 0; i--) vis[s[i]] = 0;
    int lo, hi, pre = maxd + 1;
    front = 0, rear = -1;
    for (int j = 0; j <= maxd0; j++) {
      lo = max(L - j, 0);
      hi = min(U - j, maxd);
      for (int k = pre - 1; k >= lo; k--) {
        while (front <= rear && f[s[rear]] <= f[k]) rear--;
        s[++rear] = k;
      }
      pre = min(lo, pre);
      while (front <= rear && s[front] > hi) front++;
      if (front <= rear) {
        if (f[s[front]] + g[j] > res) {
          res = f[s[front]] + g[j];
          st = F[s[front]], ed = G[j];
        }
      }
    }
    for (int j = 0; j <= maxd0; j++)
      if (j <= maxd) {
        if (g[j] > f[j]) f[j] = g[j], F[j] = G[j];
      } else
        f[j] = g[j], F[j] = G[j];
    maxd = max(maxd, maxd0);
  }
  return res;
}
bool cmp(data a, data b) { return a.depth < b.depth; }
void dfs(int x) {
  x = findroot(x);
  if (x == -1) return;
  vis[x] = 1;
  int len = 0;
  for (int i = Link[x]; i > 0; i = pre[i])
    if (!vis[t[i]]) Q[++len].t = i, Q[len].depth = getmaxdepth(t[i]);
  sort(Q + 1, Q + 1 + len, cmp);
  int l = ans, r = lim, mid;
  G[0] = F[0] = x;
  while (l != r) {
    mid = (l + r + 1) / 2;
    if (check(len, mid) >= 0) {
      l = mid;
      if (l > ans) ans = l, S = st, T = ed;
    } else
      r = mid - 1;
  }
  for (int i = Link[x]; i > 0; i = pre[i])
    if (!vis[t[i]]) dfs(t[i]);
}
int main() {
  n = get();
  L = get(), U = get();
  for (int i = 1; i < n; i++) {
    int x = get(), y = get(), z = get();
    lim = max(lim, z);
    pre[++tot] = Link[x];
    Link[x] = tot;
    t[tot] = y;
    v[tot] = z;
    pre[++tot] = Link[y];
    Link[y] = tot;
    t[tot] = x;
    v[tot] = z;
  }
  ans = -1;
  dfs(1);
  printf("%d %d\n", S, T);
  return 0;
}