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 maxn = 100010;
const int INF = 0x3f3f3f3f;
int n, m, l, r, cnt, front, tail, en, nowr;
int dist[maxn], weight[maxn], size[maxn], f[maxn], q[maxn], belong[maxn],
    num[maxn], sum[maxn];
bool vis[maxn];
struct solution {
  int v, p1, p2;
} ans, nowans;
struct place {
  int v, p;
  place() {}
  place(int a, int b) {
    v = a;
    p = b;
  }
} g[maxn];
struct priority_queue {
  place q[maxn];
  int front, tail;
  void clear() {
    front = 1;
    tail = 0;
  }
  void push(place v) {
    while (front <= tail && v.v >= q[tail].v) tail--;
    tail++;
    q[tail] = v;
  }
  place query(int p) {
    while (front <= tail && q[front].p < p) front++;
    if (front <= tail)
      return q[front];
    else
      return place(-INF, -1);
  }
} que;
struct edge {
  int e, d;
  edge *next;
} * v[maxn], ed[maxn << 1];
void add_edge(int s, int e, int d) {
  en++;
  ed[en].next = v[s];
  v[s] = ed + en;
  v[s]->e = e;
  v[s]->d = d;
}
int get_mid(int now) {
  cnt++;
  f[now] = 0;
  belong[now] = cnt;
  front = tail = 1;
  q[front] = now;
  while (front <= tail) {
    int now = q[front];
    front++;
    size[now] = weight[now] = 0;
    for (edge *e = v[now]; e; e = e->next)
      if (!vis[e->e] && belong[e->e] != cnt) {
        f[e->e] = now;
        belong[e->e] = cnt;
        tail++;
        q[tail] = e->e;
      }
  }
  for (int a = tail; a >= 1; a--) {
    int now = q[a];
    size[now]++;
    size[f[now]] += size[now];
    weight[f[now]] = max(weight[f[now]], size[now]);
    weight[now] = max(weight[now], tail - size[now]);
  }
  int p = q[1];
  for (int a = 2; a <= tail; a++)
    if (weight[q[a]] < weight[p]) p = q[a];
  size[0] = size[now];
  nowr = min(r, tail);
  return p;
}
void calc(int now, int nowdis) {
  front = tail = 1;
  q[1] = now;
  cnt++;
  belong[now] = cnt;
  while (front <= tail) {
    int now = q[front];
    front++;
    for (edge *e = v[now]; e; e = e->next)
      if (!vis[e->e] && belong[e->e] != cnt) {
        num[e->e] = num[now] + 1;
        sum[e->e] = sum[now] + (e->d >= nowdis ? 1 : -1);
        belong[e->e] = cnt;
        tail++;
        q[tail] = e->e;
      }
  }
}
bool check(int now, int nowdis) {
  for (int a = 0; a <= size[0]; a++) g[a].v = -INF;
  g[0].v = 0;
  g[0].p = now;
  nowans.v = -INF;
  for (edge *e = v[now]; e; e = e->next)
    if (!vis[e->e]) {
      num[e->e] = 1;
      sum[e->e] = e->d >= nowdis ? 1 : -1;
      calc(e->e, nowdis);
      int tmp = tail;
      while (num[q[tail]] > nowr) tail--;
      place ansv;
      ansv.v = -INF;
      for (int a = 0; a + num[q[tail]] <= nowr; a++)
        if (g[a].v > ansv.v) ansv = g[a];
      int remain = nowr - num[q[tail]];
      while (tail && num[q[tail]] >= l) {
        while (remain + 1 + num[q[tail]] <= nowr) {
          remain++;
          if (g[remain].v > ansv.v) ansv = g[remain];
        }
        if (sum[q[tail]] + ansv.v > nowans.v) {
          nowans.v = sum[q[tail]] + ansv.v;
          nowans.p1 = q[tail];
          nowans.p2 = ansv.p;
        }
        tail--;
      }
      if (tail) {
        que.clear();
        for (int a = l - num[q[tail]]; a <= nowr - num[q[tail]]; a++)
          que.push(place(g[a].v, a));
        remain = nowr - num[q[tail]];
        while (tail) {
          while (remain + 1 + num[q[tail]] <= nowr) {
            remain++;
            que.push(place(g[remain].v, remain));
          }
          ansv.p = que.query(l - num[q[tail]]).p;
          ansv.v = g[ansv.p].v;
          if (sum[q[tail]] + ansv.v > nowans.v) {
            nowans.v = sum[q[tail]] + ansv.v;
            nowans.p1 = q[tail];
            nowans.p2 = g[ansv.p].p;
          }
          tail--;
        }
      }
      for (int a = 1; a <= tmp; a++)
        if (sum[q[a]] > g[num[q[a]]].v) {
          g[num[q[a]]].v = sum[q[a]];
          g[num[q[a]]].p = q[a];
        }
    }
  return nowans.v >= 0;
}
void dfs(int now) {
  int p = get_mid(now);
  vis[p] = true;
  if (l > nowr) return;
  int lv = 1, rv = m + 1;
  while (lv + 1 != rv) {
    int m = (lv + rv) >> 1;
    if (check(p, dist[m]))
      lv = m;
    else
      rv = m;
  }
  check(p, dist[lv]);
  if (dist[lv] > ans.v) {
    ans = nowans;
    ans.v = dist[lv];
  }
  for (edge *e = v[p]; e; e = e->next)
    if (!vis[e->e]) dfs(e->e);
}
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int a = 1; a < n; a++) {
    int s, e, d;
    scanf("%d%d%d", &s, &e, &d);
    add_edge(s, e, d);
    add_edge(e, s, d);
    dist[a] = d;
  }
  m = n - 1;
  sort(dist + 1, dist + m + 1);
  m = unique(dist + 1, dist + m + 1) - dist - 1;
  ans.v = -INF;
  dfs(1);
  printf("%d %d\n", min(ans.p1, ans.p2), max(ans.p1, ans.p2));
  return 0;
}