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;
inline int read() {
  int x = 0;
  bool f = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f = (ch == '-');
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return f ? -x : x;
}
const int N = 1e5 + 7;
int n, L, R, QJ;
int u[N], v[N], val[N];
int head[N], nx[N * 2], to[N * 2], w[N * 2], ec = 1;
inline void add(int a, int b, int c) {
  nx[++ec] = head[a];
  head[a] = ec;
  to[ec] = b;
  w[ec] = c;
}
int flag;
bool been[N];
int sz[N], totsz, mxsz, g;
void getsz(int f, int x) {
  sz[x] = 1;
  for (int i = head[x]; i; i = nx[i]) {
    int t = to[i];
    if (t == f || been[t]) continue;
    getsz(x, t);
    sz[x] += sz[t];
  }
}
void getrt(int f, int x) {
  int maxsz = 0;
  for (int i = head[x]; i; i = nx[i]) {
    int t = to[i];
    if (t == f || been[t]) continue;
    getrt(x, t);
    maxsz = max(maxsz, sz[t]);
  }
  maxsz = max(maxsz, totsz - sz[x]);
  if (maxsz < mxsz) mxsz = maxsz, g = x;
}
int md[N];
int bin[N], dis[N], vdis[N];
void getmd(int f, int x) {
  md[x] = 0;
  dis[x] = -1;
  for (int i = head[x]; i; i = nx[i]) {
    int t = to[i];
    if (t == f || been[t]) continue;
    getmd(x, t);
    md[x] = max(md[x], md[t] + 1);
  }
}
inline bool judmd(int a, int b) { return md[a] < md[b]; }
struct Que {
  int a[N], h, t;
  inline void init() {
    h = 1;
    t = 0;
  }
  inline int front() { return h <= t ? bin[a[h]] : 0; }
  inline void pb(int x) {
    while (h <= t && vdis[bin[a[t]]] < vdis[bin[x]]) --t;
    a[++t] = x;
  }
  inline void pf(int r) {
    if (h <= t && a[h] >= r) ++h;
  }
} Q;
int Ans1, Ans2;
int Tmp[N];
void solve(int x) {
  if (flag) return;
  been[x] = 1;
  md[x] = 0;
  vector<int> vec;
  for (int i = head[x]; i; i = nx[i]) {
    int t = to[i];
    if (been[t]) continue;
    vec.push_back(t);
    getmd(x, t);
    md[x] = max(md[x], md[t] + 1);
    dis[t] = 1;
    vdis[t] = w[i];
  }
  sort(vec.begin(), vec.end(), judmd);
  for (int i = 1; i <= md[x]; ++i) bin[i] = -n;
  dis[x] = 0;
  bin[0] = x;
  int til = 0;
  for (int t : vec) {
    int li = L, ri = R;
    Q.init();
    if (L <= til)
      for (int i = min(R, til); i >= L; --i) Q.pb(i);
    queue<int> q;
    q.push(t);
    for (int i = 1; i <= md[t] + 1; ++i) Tmp[i] = -n;
    while (q.size()) {
      int y = q.front();
      q.pop();
      if (dis[y] <= R) {
        int er = R - dis[y];
        if (ri > er) {
          Q.pf(ri);
          --li, --ri;
          if (li >= 0 && li <= til) Q.pb(li);
        }
      }
      int qf = Q.front();
      if (qf && dis[y] <= R && vdis[y] + vdis[qf] >= 0) {
        flag = 1, Ans1 = y, Ans2 = qf;
        return;
      }
      if (Tmp[dis[y]] < 0 || vdis[Tmp[dis[y]]] < vdis[y]) Tmp[dis[y]] = y;
      for (int i = head[y]; i; i = nx[i]) {
        int r = to[i];
        if (dis[r] == -1 && !been[r])
          dis[r] = dis[y] + 1, vdis[r] = vdis[y] + w[i], q.push(r);
      }
    }
    til = max(til, md[t] + 1);
    for (int j = 1; j <= til; ++j)
      if (bin[j] < 0 || vdis[Tmp[j]] > vdis[bin[j]]) bin[j] = Tmp[j];
  }
  for (int i = head[x]; i; i = nx[i]) {
    int t = to[i];
    if (been[t]) continue;
    getsz(x, t);
    totsz = mxsz = sz[t];
    getrt(x, t);
    solve(g);
  }
}
inline bool check(int mid) {
  ec = 1;
  memset(head, 0, sizeof(head));
  for (int i = 1; i < n; ++i) {
    add(u[i], v[i], val[i] >= mid ? 1 : -1);
    add(v[i], u[i], val[i] >= mid ? 1 : -1);
  }
  memset(been, 0, sizeof(been));
  flag = 0;
  getsz(0, 1);
  totsz = mxsz = sz[1];
  getrt(0, 1);
  solve(g);
  return flag;
}
int main() {
  n = read();
  L = read();
  R = read();
  for (int i = 1; i < n; ++i)
    u[i] = read(), v[i] = read(), val[i] = read(), QJ = max(QJ, val[i]);
  int lg = 0, rg = QJ;
  if (QJ == 0) return puts("1 2"), 0;
  while (lg < rg) {
    int mid = (lg + rg + 1) >> 1;
    if (check(mid))
      lg = mid;
    else
      rg = mid - 1;
  }
  printf("%d %d\n", Ans1, Ans2);
  return 0;
}