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;
int n, l, r;
vector<pair<int, int> > G[100005];
int seq[100005], cnts, siz[100005], rch[100005], num[100005];
bool vis[100005];
int rt, Min;
void dfs(int now, int ff, int tsz) {
  int Max = 0;
  siz[now] = 1;
  rch[now] = 0;
  for (int i = 0, v, sz = G[now].size(); i < sz; i++)
    if ((v = G[now][i].first) != ff && !vis[v]) {
      dfs(v, now, tsz);
      rch[now] = max(rch[now], rch[v] + 1);
      siz[now] += siz[v];
      Max = max(Max, siz[v]);
    }
  Max = max(Max, tsz - siz[now]);
  if (Max < Min) Min = Max, rt = now;
}
int Gert(int now, int tsz) {
  Min = 0x3f3f3f3f;
  dfs(now, -1, tsz);
  return rt;
}
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return rch[a.first] < rch[b.first];
}
void setsiz(int now, int ff) {
  siz[now] = 1, rch[now] = 0;
  for (int i = 0, sz = G[now].size(), v; i < sz; i++)
    if ((v = G[now][i].first) != ff && !vis[v]) {
      setsiz(v, now);
      siz[now] += siz[v];
      rch[now] = max(rch[now], rch[v] + 1);
    }
}
void Solve(int now) {
  seq[++cnts] = now;
  setsiz(now, -1);
  vis[now] = 1;
  rch[now] = 0;
  sort(G[now].begin(), G[now].end(), cmp);
  for (int v, i = 0, sz = G[now].size(); i < sz; i++)
    if (!vis[(v = G[now][i].first)]) Solve(Gert(v, siz[v]));
}
int f[100005], g[100005], floc[100005], gloc[100005], ansx, ansy;
int Maxdep;
void ser(int now, int ff, int dist, int cost, int Lim) {
  Maxdep = max(Maxdep, dist);
  if (cost > g[dist]) g[dist] = cost, gloc[dist] = now;
  for (int i = 0, sz = G[now].size(), v; i < sz; i++)
    if ((v = G[now][i].first) != ff && !vis[v])
      ser(v, now, dist + 1, cost + (G[now][i].second >= Lim ? 1 : -1), Lim);
}
int Q[100005], L, R;
bool check(int Lim) {
  memset(vis, 0, sizeof vis);
  memset(f, -0x3f, sizeof f);
  memset(g, -0x3f, sizeof g);
  f[0] = 0;
  int premaxdep = 0;
  for (int u, id = 1; id <= n; id++) {
    for (int i = 1; i <= premaxdep; i++) f[i] = -0x3f3f3f3f, g[i] = -0x3f3f3f3f;
    premaxdep = 0;
    vis[u = seq[id]] = 1;
    floc[0] = u;
    for (int predep = 0, i = 0, v, sz = G[u].size(); i < sz; i++)
      if (!vis[v = G[u][i].first]) {
        for (int j = 1; j <= predep; j++) g[j] = -0x3f3f3f3f;
        Maxdep = 0;
        ser(v, -1, 1, G[u][i].second >= Lim ? 1 : -1, Lim);
        L = R = 0;
        for (int j = 0, k = min(r, Maxdep); j <= predep; j++) {
          for (; j + k >= l && k >= 0; k--) {
            for (; L < R && g[k] >= g[Q[R - 1]]; R--)
              ;
            Q[R++] = k;
          }
          for (; L < R && Q[L] + j > r; L++)
            ;
          if (L < R && f[j] + g[Q[L]] >= 0) {
            ansx = floc[j];
            ansy = gloc[Q[L]];
            return 1;
          }
        }
        for (int j = 1; j <= Maxdep; j++)
          if (f[j] < g[j]) f[j] = g[j], floc[j] = gloc[j];
        predep = Maxdep;
        premaxdep = max(premaxdep, Maxdep);
      }
  }
  return 0;
}
int main() {
  int u, v, w;
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &u, &v, &w);
    G[u].push_back(make_pair(v, w));
    G[v].push_back(make_pair(u, w));
  }
  Solve(Gert(1, n));
  int L = 0, R = 1000000000, Mid;
  while (L < R) {
    Mid = (L + R + 1) >> 1;
    if (check(Mid))
      L = Mid;
    else
      R = Mid - 1;
  }
  check(L);
  printf("%d %d\n", ansx, ansy);
}