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 = 100000;
const int INF = 0x3f3f3f3f;
struct node {
  int v, w;
  node *next;
} Edges[MAXN * 2 + 10], *ecnt = Edges, *adj[MAXN + 10];
void addedge(int u, int v, int w) {
  ++ecnt;
  ecnt->v = v;
  ecnt->w = w;
  ecnt->next = adj[u];
  adj[u] = ecnt;
}
pair<int, pair<int, int> > lis[MAXN + 10];
pair<int, int> pri_que[MAXN + 10];
int n, l, r, mlen, mxsum[MAXN + 10], mxcur[MAXN + 10];
int cur_pos[MAXN + 10], sum_pos[MAXN + 10];
int sz[MAXN + 10], global_lim;
bool vis[MAXN + 10];
void dfs_sz(int u, int fa) {
  sz[u] = 1;
  for (node *p = adj[u]; p; p = p->next) {
    if (p->v == fa || vis[p->v]) continue;
    dfs_sz(p->v, u);
    sz[u] += sz[p->v];
  }
}
void dfs_root(int u, int fa, int &rt, int &root, int &cmx) {
  int mx = 0;
  for (node *p = adj[u]; p; p = p->next) {
    if (p->v == fa || vis[p->v]) continue;
    mx = max(mx, sz[p->v]);
  }
  mx = max(mx, sz[rt] - sz[u]);
  if (mx < cmx) {
    cmx = mx;
    root = u;
  }
  for (node *p = adj[u]; p; p = p->next) {
    if (p->v == fa || vis[p->v]) continue;
    dfs_root(p->v, u, rt, root, cmx);
  }
}
int getDep(int u, int fa) {
  int ret = 0;
  for (node *p = adj[u]; p; p = p->next) {
    if (p->v == fa || vis[p->v]) continue;
    ret = max(ret, getDep(p->v, u) + 1);
  }
  return ret + 1;
}
void dfs_sum(int u, int fa, int dsum, int dep = 1) {
  if (dsum > mxcur[dep]) {
    mxcur[dep] = dsum;
    cur_pos[dep] = u;
  }
  for (node *p = adj[u]; p; p = p->next) {
    if (p->v == fa || vis[p->v]) continue;
    dfs_sum(p->v, u, dsum + (p->w >= global_lim ? 1 : -1), dep + 1);
  }
}
vector<pair<int, int> > vec[MAXN + 10];
bool sorted[MAXN + 10];
int tmp[MAXN + 10], current_ans, global_mid;
pair<int, int> res;
void dfs(int u) {
  dfs_sz(u, 0);
  int Root = 0, cmx = 0x3f3f3f3f;
  dfs_root(u, 0, u, Root, cmx);
  u = Root;
  for (node *p = adj[u]; p; p = p->next) {
    if (vis[p->v]) continue;
    vec[u].push_back(make_pair(getDep(p->v, u), p->v));
  }
  sort(vec[u].begin(), vec[u].end());
  sum_pos[0] = u;
  int L = current_ans + 1, R = 0x3f3f3f3f;
  while (L <= R) {
    int mid = (L + R) >> 1;
    global_lim = mid;
    bool ok = false;
    for (node *p = adj[u]; p; p = p->next) {
      if (vis[p->v]) continue;
      tmp[p->v] = p->w >= global_lim ? 1 : -1;
    }
    for (int i = 0; !ok && i < (int)vec[u].size(); i++) {
      for (int j = 1; j <= vec[u][i].first; j++) mxcur[j] = -INF;
      dfs_sum(vec[u][i].second, u, tmp[vec[u][i].second]);
      int L = 0, R = 0, bp = r - min(r, vec[u][i].first);
      for (int j = 0; j < bp; j++) {
        if (mxsum[j] == -INF) break;
        while (R - L && pri_que[L].first < j - mlen) L++;
        while (R - L && pri_que[R - 1].second < mxsum[j]) R--;
        pri_que[R++] = make_pair(j, mxsum[j]);
      }
      for (int j = min(r, vec[u][i].first); j >= 1; j--) {
        while (R - L && pri_que[L].first < r - j - mlen) L++;
        if (mxsum[r - j] != -INF) {
          while (R - L && pri_que[R - 1].second < mxsum[r - j]) R--;
          pri_que[R++] = make_pair(r - j, mxsum[r - j]);
        }
        if (R - L && mxcur[j] + pri_que[L].second >= 0) {
          ok = true;
          res = make_pair(sum_pos[pri_que[L].first], cur_pos[j]);
          break;
        }
      }
      for (int j = 1; j <= vec[u][i].first; j++) {
        if (mxcur[j] > mxsum[j]) {
          mxsum[j] = mxcur[j];
          sum_pos[j] = cur_pos[j];
        }
      }
    }
    if (ok) {
      L = mid + 1;
      current_ans = mid;
    } else
      R = mid - 1;
    if (vec[u].size()) {
      int mxdep = vec[u][vec[u].size() - 1].first;
      for (int i = 1; i <= mxdep; i++) mxsum[i] = -INF;
    }
  }
  vis[u] = true;
  for (node *p = adj[u]; p; p = p->next) {
    if (vis[p->v]) continue;
    dfs(p->v);
  }
}
int main() {
  scanf("%d%d%d", &n, &l, &r);
  mlen = r - l;
  for (int i = 1; i < n; i++) {
    scanf("%d%d%d", &lis[i].second.first, &lis[i].second.second, &lis[i].first);
    addedge(lis[i].second.first, lis[i].second.second, lis[i].first);
    addedge(lis[i].second.second, lis[i].second.first, lis[i].first);
  }
  for (int i = 1; i <= n; i++) mxsum[i] = -INF;
  current_ans = -1;
  dfs(1);
  printf("%d %d\n", res.first, res.second);
  return 0;
}