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 = 100005, M = N * 20, mod = 1e9 + 7, inf = 0x3f3f3f3f;
const pair<int, int> zero = make_pair(-inf, -inf);
template <class T>
inline void gmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <class T>
inline void gmax(T &x, const T &y) {
  if (x < y) x = y;
}
inline void ch(int &x, int y) { x = (x + y) % mod; }
inline void read(int &x) {
  x = 0;
  char ch = getchar(), rev = 0;
  while (ch > '9' || ch < '0') rev = (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x = rev ? -x : x;
}
inline int exp(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = (long long)ans * x % mod;
    x = (long long)x * x % mod;
    y >>= 1;
  }
  return ans;
}
struct node {
  int to, next, w;
} p[N << 1];
int a[N], ansu, ansv, d;
int n, m, tot = 1, L, R, res, root, head[N], u[N], v[N], w[N];
pair<int, int> now[N];
bool vis[N];
inline void add(int x, int y, int z) {
  p[++tot] = (node){y, head[x], z};
  head[x] = tot;
  p[++tot] = (node){x, head[y], z};
  head[y] = tot;
}
namespace sgt {
pair<int, int> p[M];
int c[M][2], root, cnt;
inline void clear() {
  root = cnt = 0;
  p[0] = make_pair(-inf, -inf);
}
inline void ch(int l, int r, int x, pair<int, int> b, int &k = root) {
  p[++cnt] = max(p[k], b);
  memcpy(c[cnt], c[k], sizeof(c[cnt]));
  k = cnt;
  if (l == r) return;
  int mid = l + r >> 1;
  if (x <= mid)
    ch(l, mid, x, b, c[k][0]);
  else
    ch(mid + 1, r, x, b, c[k][1]);
}
inline pair<int, int> get(int l, int r, int x, int y, int k = root) {
  if (!k) return zero;
  if (x <= l && r <= y) return p[k];
  int mid = l + r >> 1;
  pair<int, int> ans = zero;
  if (x <= mid) gmax(ans, get(l, mid, x, y, c[k][0]));
  if (y > mid) gmax(ans, get(mid + 1, r, x, y, c[k][1]));
  return ans;
}
}  // namespace sgt
inline int getsize(int x, int f) {
  int tmp = 1;
  for (int i = head[x]; i; i = p[i].next) {
    int y = p[i].to;
    if (vis[y] || y == f) continue;
    tmp += getsize(y, x);
  }
  return tmp;
}
inline int getroot(int x, int f) {
  int now = 1, tmp = 0;
  for (int i = head[x]; i; i = p[i].next) {
    int y = p[i].to, t;
    if (vis[y] || y == f) continue;
    t = getroot(y, x);
    now += t;
    gmax(tmp, t);
  }
  gmax(tmp, m - now);
  if (tmp < res) res = tmp, root = x;
  return now;
}
inline void dfs(int x, int f, int len, int val) {
  gmax(now[len], make_pair(val, x));
  gmax(d, len);
  for (int i = head[x]; i; i = p[i].next) {
    int y = p[i].to;
    if (vis[y] || y == f) continue;
    dfs(y, x, len + 1, val + p[i].w);
  }
}
bool dfs(int x) {
  if (m <= L) return 0;
  vis[x] = 1;
  sgt::clear();
  int tmp = 0;
  sgt::ch(0, n, 0, make_pair(0, x));
  for (int i = head[x]; i; i = p[i].next) {
    int y = p[i].to;
    if (vis[y]) continue;
    d = 0;
    dfs(y, x, 1, p[i].w);
    gmin(d, R);
    for (int j = 1; j <= d; j++)
      if (now[j].first + sgt::get(0, n, max(0, L - j), R - j).first >= 0) {
        ansu = now[j].second;
        ansv = sgt::get(0, n, max(0, L - j), R - j).second;
        return 1;
      }
    for (int j = 1; j <= d; j++) sgt::ch(0, n, j, now[j]), now[j] = zero;
  }
  for (int i = head[x]; i; i = p[i].next) {
    int y = p[i].to;
    if (vis[y]) continue;
    res = m = getsize(y, x);
    getroot(y, x);
    if (dfs(root)) return 1;
  }
  return 0;
}
inline bool check(int x) {
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= n; i++) now[i] = zero;
  for (int i = 1; i < n; i++)
    p[i << 1].w = p[i << 1 | 1].w = (w[i] >= x) ? 1 : -1;
  res = m = n;
  getroot(1, 0);
  return dfs(root);
}
int main() {
  read(n);
  read(L);
  read(R);
  for (int i = 1; i < n; i++)
    read(u[i]), read(v[i]), read(w[i]), add(u[i], v[i], 0), a[i] = w[i];
  sort(a + 1, a + n);
  int k = unique(a + 1, a + n) - a - 1;
  int l = 1, r = k;
  while (l < r) {
    int mid = l + r + 1 >> 1;
    if (check(a[mid]))
      l = mid;
    else
      r = mid - 1;
  }
  check(a[r]);
  printf("%d %d\n", ansu, ansv);
  return 0;
}