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 read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
using namespace std;
const int inf = 987654321;
inline void MAX(int &a, int b) {
  if (b > a) a = b;
}
int n;
int ans, X, Y, Mx;
struct edge {
  int nxt, to, val;
} e[101000 << 1];
int head[101000], ecnt;
inline void addedge(int from, int to, int val) {
  e[++ecnt] = (edge){head[from], to, val};
  head[from] = ecnt;
}
int L, R;
int siz[101000], mxSiz, Siz, root;
bool vis[101000];
void find_root(int cur, int faa) {
  siz[cur] = 1;
  int mx = 0;
  for (register int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to;
    if (vis[to] || to == faa) continue;
    find_root(to, cur);
    siz[cur] += siz[to];
    MAX(mx, siz[to]);
  }
  MAX(mx, Siz - siz[cur]);
  if (mx < mxSiz) mxSiz = mx, root = cur;
}
int pv[101000], d[101000];
int dfs_dep(int cur, int faa, int nwd) {
  int res = nwd;
  for (register int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to;
    if (to == faa || vis[to]) continue;
    MAX(res, dfs_dep(to, cur, nwd + 1));
  }
  return res;
}
int arr[101000], atot;
bool cmp(const int x, const int y) { return d[x] < d[y]; }
pair<int, int> h[101000], H[101000];
int stk[101000], st, ed, htot, Htot;
void dfs_h(int cur, int faa, int nwd, int nwv, int t) {
  if (nwv > h[nwd].first) h[nwd] = make_pair(nwv, cur);
  for (register int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to;
    if (to == faa || vis[to]) continue;
    dfs_h(to, cur, nwd + 1, nwv + (e[i].val >= t ? 1 : -1), t);
  }
}
inline bool calc(int t) {
  htot = Htot = 0;
  for (register int i = 1; i <= atot; ++i) {
    dfs_h(arr[i], 0, 1, pv[arr[i]] >= t ? 1 : -1, t);
    st = ed = 0;
    --ed;
    int l = L, r = R;
    for (register int j = min(r, Htot); j >= l; --j) {
      while (st <= ed && H[stk[ed]] <= H[j]) --ed;
      stk[++ed] = j;
    }
    htot = d[arr[i]];
    for (register int j = 1; j <= htot; ++j) {
      if (st <= ed && stk[st] == r) ++st;
      --r;
      if (r < 0) break;
      --l;
      if (l <= Htot && l >= 0) {
        while (st <= ed && H[stk[ed]] <= H[l]) --ed;
        stk[++ed] = l;
      }
      if (st <= ed && H[stk[st]].first + h[j].first >= 0) {
        ans = t;
        X = H[stk[st]].second;
        Y = h[j].second;
        for (register int p = 1; p <= Htot; ++p) H[p] = make_pair(-inf, -1);
        for (register int p = 1; p <= htot; ++p) h[p] = make_pair(-inf, -1);
        return true;
      }
    }
    for (register int i = 1; i <= htot; ++i) {
      if (h[i] > H[i]) H[i] = h[i];
      h[i].first = -inf;
      h[i].second = -1;
    }
    Htot = htot;
  }
  for (register int i = 1; i <= Htot; ++i) H[i].first = -inf;
  return false;
}
void dfs(int cur) {
  vis[cur] = true;
  atot = 0;
  for (register int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to;
    if (vis[to]) continue;
    d[to] = dfs_dep(to, cur, 1);
    pv[to] = e[i].val;
    arr[++atot] = to;
  }
  sort(arr + 1, arr + 1 + atot, cmp);
  H[0] = make_pair(0, cur);
  int l = ans + 1, r = Mx;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (calc(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  for (register int i = head[cur]; i; i = e[i].nxt) {
    int to = e[i].to;
    if (vis[to]) continue;
    Siz = siz[to], mxSiz = Siz;
    find_root(to, cur);
    dfs(root);
  }
}
int main() {
  memset(h, 0xc0, sizeof(h));
  memset(H, 0xc0, sizeof(H));
  read(n), read(L), read(R);
  for (register int i = 1; i < n; ++i) {
    int u, v, w;
    read(u), read(v), read(w);
    addedge(u, v, w), addedge(v, u, w);
    MAX(Mx, w);
  }
  Siz = n, mxSiz = n;
  find_root(1, 0);
  ans = -1;
  dfs(root);
  printf("%d %d\n", X, Y);
  return 0;
}