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 = 100010;
struct edge {
  int v, dis, next;
} e[2 * N];
int head[N], cnt;
void addedge(int u, int v, int dis) {
  e[cnt].v = v;
  e[cnt].dis = dis;
  e[cnt].next = head[u];
  head[u] = cnt++;
}
int dis[N];
int ct, size[N], msize[N], visit[N], len[N];
struct point {
  int x, y, id;
  point() {}
  point(int x, int y, int id = 0) : x(x), y(y), id(id) {}
  friend bool operator<(const point &p, const point &q) { return p.y < q.y; }
} a[N], f[N], ff[N];
void dfs(int u, int fa) {
  size[u] = 1;
  msize[u] = 0;
  for (int i = head[u]; i != -1; i = e[i].next)
    if (e[i].v != fa && !visit[e[i].v]) {
      dfs(e[i].v, u);
      size[u] += size[e[i].v];
      msize[u] = max(msize[u], size[e[i].v]);
    }
  a[ct++] = point(u, msize[u]);
}
int get_center(int u) {
  ct = 0;
  dfs(u, 0);
  int ans = 0;
  int mi = 0x7fffffff;
  int sum = size[u];
  for (int i = 0; i < ct; i++) {
    a[i].y = max(a[i].y, sum - a[i].y);
    if (a[i].y < mi) {
      mi = a[i].y;
      ans = a[i].x;
    }
  }
  return ans;
}
struct tree {
  int lt, rt;
  int max;
} T[N * 4];
void init(int lt, int rt, int step) {
  T[step].lt = lt;
  T[step].rt = rt;
  T[step].max = -1000000000;
  if (lt == rt) return;
  int mid = (lt + rt) / 2;
  init(lt, mid, 2 * step);
  init(mid + 1, rt, 2 * step + 1);
}
int query(int lt, int rt, int step) {
  if (lt > rt) return -1000000000;
  if (T[step].lt == lt && T[step].rt == rt) return T[step].max;
  if (rt <= T[2 * step].rt) return query(lt, rt, 2 * step);
  if (lt > T[2 * step].rt) return query(lt, rt, 2 * step + 1);
  return max(query(lt, T[2 * step].rt, 2 * step),
             query(T[2 * step + 1].lt, rt, 2 * step + 1));
}
void insert(int pos, int step, int val) {
  if (T[step].lt == T[step].rt) {
    T[step].max = max(val, T[step].max);
    return;
  }
  if (pos <= T[2 * step].rt)
    insert(pos, 2 * step, val);
  else
    insert(pos, 2 * step + 1, val);
  T[step].max = max(T[2 * step].max, T[2 * step + 1].max);
}
void resume(int pos, int step) {
  if (T[step].lt == T[step].rt) {
    T[step].max = -1000000000;
    return;
  }
  if (pos <= T[step * 2].rt)
    resume(pos, 2 * step);
  else
    resume(pos, 2 * step + 1);
  T[step].max = max(T[2 * step].max, T[2 * step + 1].max);
}
int ans, re[N];
int L, R;
int Mid;
bool flag;
int ansx, ansy;
int root;
int change(int x) {
  if (x >= Mid) return 1;
  return -1;
}
bool judge(int dist, int len) { return dist >= 0; }
int mm;
void dfs(int u, int fa, int dist, int len) {
  if (flag) return;
  if (len >= L && len <= R) flag |= judge(dist, len);
  mm = max(mm, len);
  ansx = u;
  ansy = root;
  f[ct++] = point(dist, len, u);
  for (int i = head[u]; i != -1 && !flag; i = e[i].next)
    if (e[i].v != fa && !visit[e[i].v] && dist + 1 <= R)
      dfs(e[i].v, u, dist + change(e[i].dis), len + 1);
}
int dp[N][2];
int maxL[N];
void solve(int u) {
  if (flag) return;
  visit[u] = 1;
  int cc = 0;
  int maxn = -1000000000;
  for (int i = head[u]; i != -1 && !flag; i = e[i].next) {
    if (visit[e[i].v]) continue;
    ct = 0;
    root = u;
    mm = -1000000000;
    dfs(e[i].v, u, change(e[i].dis), 1);
    if (mm + dp[u][0] < L) continue;
    for (int j = 0; j < ct && maxn >= 0; j++) {
      if (f[j].y + maxn < L) continue;
      int x = query(max(1, L - f[j].y), R - f[j].y, 1);
      if (x + f[j].x < 0) continue;
      flag = true;
      for (int k = 0; k < cc; k++) {
        if (f[j].x + ff[k].x >= 0 && f[j].y + ff[k].y <= R &&
            f[j].y + ff[k].y >= L) {
          ansx = f[j].id;
          ansy = ff[k].id;
          sort(ff, ff + cc);
          for (int i = 0; i < cc; i++) {
            if (i > 0 && ff[i].y == ff[i - 1].y) continue;
            resume(ff[i].y, 1);
            maxL[ff[i].y] = -1000000000;
          }
          return;
        }
      }
    }
    maxn = max(maxn, mm);
    for (int j = 0; j < ct; j++) {
      if (maxL[f[j].y] >= f[j].x) continue;
      insert(f[j].y, 1, f[j].x);
      ff[cc++] = f[j];
      maxL[f[j].y] = f[j].x;
    }
  }
  sort(ff, ff + cc);
  for (int i = 0; i < cc; i++) {
    if (i > 0 && ff[i].y == ff[i - 1].y) continue;
    resume(ff[i].y, 1);
    maxL[ff[i].y] = -1000000000;
  }
}
void sure(int u, int fa) {
  dp[u][0] = dp[u][1] = 0;
  for (int i = head[u]; i != -1; i = e[i].next)
    if (!visit[e[i].v] && e[i].v != fa) {
      sure(e[i].v, u);
      if (dp[u][0] < 1 + dp[e[i].v][0]) {
        dp[u][1] = dp[u][0];
        dp[u][0] = dp[e[i].v][0] + 1;
      } else
        dp[u][1] = max(dp[u][1], 1 + dp[e[i].v][0]);
    }
}
void cal(int u, int fa) {
  mm = u;
  u = get_center(u);
  if (size[mm] < L + 1) return;
  ct = 0;
  sure(u, 0);
  if (dp[u][0] + dp[u][1] < L) return;
  solve(u);
  for (int i = head[u]; i != -1 && !flag; i = e[i].next)
    if (e[i].v != fa && !visit[e[i].v]) {
      cal(e[i].v, u);
    }
}
int edgee[N];
int main() {
  int n;
  int x, y, z;
  scanf("%d%d%d", &n, &L, &R);
  memset(head, -1, sizeof(head));
  cnt = 0;
  ans = 0;
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &x, &y, &z);
    addedge(x, y, z);
    addedge(y, x, z);
    edgee[i] = z;
  }
  sort(edgee + 1, edgee + n);
  int cc = 1;
  x = edgee[(L + 1) / 2];
  y = edgee[n - (L + 1) / 2];
  for (int i = 2; i < n; i++)
    if (edgee[i] != edgee[cc]) edgee[++cc] = edgee[i];
  int lt = 1, rt = cc, mid;
  for (int i = 1; i <= cc; i++)
    if (edgee[i] == x)
      lt = i;
    else if (edgee[i] == y)
      rt = i;
  if (lt > rt) swap(lt, rt);
  init(1, n - 1, 1);
  for (int i = 1; i <= n; i++) maxL[i] = -1000000000;
  int prex, prey;
  while (lt <= rt) {
    mid = (lt + rt) / 2;
    Mid = edgee[mid];
    flag = false;
    memset(visit, 0, sizeof(visit));
    cal(1, 0);
    if (flag)
      prex = ansx, prey = ansy, ans = Mid, lt = mid + 1;
    else
      rt = mid - 1;
  }
  printf("%d %d\n", prex, prey);
  return 0;
}