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>
int read() {
  int x = 0;
  char c = getchar();
  while (c < 48) c = getchar();
  while (c > 47) x = x * 10 + (c - 48), c = getchar();
  return x;
}
int min(int x, int y) { return x < y ? x : y; }
int max(int x, int y) { return x > y ? x : y; }
int n, L, R;
const int maxn = 2e5 + 52;
struct edge {
  int v, nxt, w;
} e[maxn << 1];
int head[maxn], cnt = 0, val[maxn];
void add(int u, int v, int w) {
  e[++cnt] = {v, head[u], w}, head[u] = cnt;
  e[++cnt] = {u, head[v], w}, head[v] = cnt;
}
int len[maxn], son[maxn], wt[maxn];
void dfs(int u, int fa) {
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == fa) continue;
    dfs(v, u);
    if (len[v] > len[son[u]]) {
      son[u] = v, wt[u] = e[i].w;
    }
  }
  len[u] = len[son[u]] + 1;
}
int dfn[maxn], idx = 0;
void dfs(int u) {
  dfn[u] = ++idx;
  if (son[u]) dfs(son[u]);
  for (int i = head[u]; i; i = e[i].nxt)
    if (!dfn[e[i].v]) dfs(e[i].v);
}
struct node {
  int mx, t;
} sum[maxn << 2];
int tag[maxn << 2];
node merge(const node& x, const node& y) { return x.mx > y.mx ? x : y; }
void clr(int l, int r, int rt) {
  tag[rt] = sum[rt].t = 0, sum[rt].mx = -n;
  if (l == r) return;
  int mid = l + r >> 1;
  clr(l, mid, rt << 1);
  clr(mid + 1, r, rt << 1 | 1);
}
void pushtag(int rt, int v) { tag[rt] += v, sum[rt].mx += v; }
void pushd(int rt) {
  if (!tag[rt]) return;
  pushtag(rt << 1, tag[rt]);
  pushtag(rt << 1 | 1, tag[rt]);
  tag[rt] = 0;
}
node qry(int a, int b, int l, int r, int rt) {
  if (a <= l && r <= b) return sum[rt];
  pushd(rt);
  int mid = l + r >> 1;
  if (b <= mid) return qry(a, b, l, mid, rt << 1);
  if (a > mid) return qry(a, b, mid + 1, r, rt << 1 | 1);
  return merge(qry(a, b, l, mid, rt << 1), qry(a, b, mid + 1, r, rt << 1 | 1));
}
void change(int a, int b, int l, int r, int rt, int v) {
  if (a <= l && r <= b) {
    pushtag(rt, v);
    return;
  }
  pushd(rt);
  int mid = l + r >> 1;
  if (a <= mid) change(a, b, l, mid, rt << 1, v);
  if (b > mid) change(a, b, mid + 1, r, rt << 1 | 1, v);
  sum[rt] = merge(sum[rt << 1], sum[rt << 1 | 1]);
}
void modify(int l, int r, int rt, int x, node v) {
  if (l == r) {
    sum[rt] = merge(sum[rt], v);
    return;
  }
  pushd(rt);
  int mid = l + r >> 1;
  if (x <= mid)
    modify(l, mid, rt << 1, x, v);
  else
    modify(mid + 1, r, rt << 1 | 1, x, v);
  sum[rt] = merge(sum[rt << 1], sum[rt << 1 | 1]);
}
int flag = 0, xx = 0, yy = 0;
void dfs(int u, int fa, int mid) {
  if (flag) return;
  modify(1, n, 1, dfn[u], {0, u});
  if (!son[u]) return;
  dfs(son[u], u, mid);
  change(dfn[u] + 1, dfn[u] + len[u] - 1, 1, n, 1, wt[u] >= mid ? 1 : -1);
  if (L < len[u]) {
    node ask = qry(dfn[u] + L, dfn[u] + min(len[u] - 1, R), 1, n, 1);
    if (ask.mx >= 0) {
      flag = 1;
      xx = u, yy = ask.t;
      return;
    }
  }
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == fa || v == son[u]) continue;
    dfs(v, u, mid);
    int w = e[i].w >= mid ? 1 : -1;
    for (int j = 1; j <= len[v]; j++) {
      node c = qry(dfn[v] + j - 1, dfn[v] + j - 1, 1, n, 1);
      c.mx += w;
      if (L - j >= len[u] || j > R) continue;
      node ask =
          qry(dfn[u] + max(0, L - j), dfn[u] + min(len[u] - 1, R - j), 1, n, 1);
      if (c.mx + ask.mx >= 0) {
        xx = c.t, yy = ask.t;
        flag = 1;
        break;
      }
    }
    for (int j = 1; j <= len[v]; j++) {
      node c = qry(dfn[v] + j - 1, dfn[v] + j - 1, 1, n, 1);
      c.mx += w, modify(1, n, 1, dfn[u] + j, c);
    }
  }
}
bool chk(int mid) {
  clr(1, n, 1);
  flag = 0, dfs(1, 0, mid);
  return flag;
}
int main() {
  n = read(), L = read(), R = read();
  for (int i = 1; i < n; i++) {
    int u = read(), v = read(), w = read();
    add(u, v, w), val[i] = w;
  }
  dfs(1, 0), dfs(1), std ::sort(val + 1, val + n);
  int le = 1, ri = std ::unique(val + 1, val + n) - val - 1;
  int ansx = 0, ansy = 0;
  while (le <= ri) {
    int mid = le + ri >> 1;
    if (chk(val[mid])) {
      le = mid + 1;
      ansx = xx, ansy = yy;
    } else
      ri = mid - 1;
  }
  printf("%d %d\n", ansx, ansy);
  return 0;
}