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;
void file(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
template <typename Tp>
void read(Tp &x) {
  int fh = 1;
  char c = getchar();
  x = 0;
  while (c > '9' || c < '0') {
    if (c == '-') {
      fh = -1;
    }
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c & 15);
    c = getchar();
  }
  x *= fh;
}
int ta[100005], tat;
struct Edge {
  int f, t, w, nxt;
} edge[200005];
int head[100005], etot = 1;
void add_edge(int f, int t, int w = 0) {
  edge[++etot] = (Edge){f, t, w, head[f]};
  head[f] = etot;
}
void lsh() {
  for (int i = 1; (i << 1) <= etot; ++i) ta[++tat] = edge[i << 1].w;
  sort(ta + 1, ta + tat + 1);
  tat = unique(ta + 1, ta + tat + 1) - ta - 1;
  for (int i = 2; i <= etot; ++i)
    edge[i].w = lower_bound(ta + 1, ta + tat + 1, edge[i].w) - ta;
}
vector<pair<int, int> > dG[100005];
int RT;
int n, D, U;
int g;
int tmpt[100005], ttot;
namespace DFT {
int vis[100005], siz[100005], msz[100005];
void dfs1(int x, int pa) {
  siz[x] = 1;
  msz[x] = siz[x];
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (vis[y] || y == pa) continue;
    dfs1(y, x);
    siz[x] += siz[y];
    msz[x] = max(msz[x], siz[y]);
  }
}
void dfs2(int x, int pa, int sal, int &rt) {
  msz[x] = max(msz[x], sal - siz[x]);
  if (msz[x] <= (sal + 1) / 2) rt = x;
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (vis[y] || y == pa) continue;
    dfs2(y, x, sal, rt);
  }
}
int get_centre(int r) {
  int ret = r;
  dfs1(r, 0);
  dfs2(r, 0, siz[r], ret);
  return ret;
}
int vsd[100005], dep[100005];
int dfa[100005];
int bfs(int S) {
  int ret = 0;
  queue<int> q;
  q.push(S);
  dep[S] = 0;
  ttot = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    ret = max(ret, dep[x]);
    vsd[x] = 1;
    tmpt[++ttot] = x;
    for (int i = head[x]; i; i = edge[i].nxt) {
      int y = edge[i].t;
      if (vis[y] || vsd[y]) continue;
      dep[y] = dep[x] + 1;
      q.push(y);
    }
  }
  for (int i = 1; i <= ttot; ++i) vsd[tmpt[i]] = 0;
  return ret;
}
void dfs_p(int x, int pa) {
  int rt = get_centre(x);
  int mmdp = bfs(rt);
  vis[rt] = 1;
  dfa[rt] = pa;
  if (pa)
    dG[pa].push_back(make_pair(mmdp, rt));
  else
    RT = rt;
  for (int i = head[rt]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (vis[y]) continue;
    dfs_p(y, rt);
  }
  sort(dG[x].begin(), dG[x].end());
}
void Prep() { dfs_p(1, 0); }
}  // namespace DFT
int FLG;
int ansx, ansy;
int dis[100005];
int vis0[100005];
void get_dis(int x, int pa) {
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (y == pa || vis0[y]) continue;
    dis[y] = dis[x] + ((edge[i].w >= g) ? 1 : -1);
    get_dis(y, x);
  }
}
int hh[100005], hy[100005];
int vd[100005];
int qq[100005], ql, qr;
int cmxd;
void get_ans(int S) {
  queue<pair<int, int> > q;
  q.push(make_pair(S, 1));
  ttot = 0;
  ql = 1, qr = 0;
  int qpos = min(cmxd, U - 1);
  while (!q.empty()) {
    int x = q.front().first, d = q.front().second;
    q.pop();
    vd[x] = 1;
    tmpt[++ttot] = x;
    while (qpos >= 0 && qpos + d >= D) {
      while (ql <= qr && hh[qq[qr]] <= hh[qpos]) --qr;
      qq[++qr] = qpos;
      --qpos;
    }
    while (ql <= qr && qq[ql] + d > U) ++ql;
    if (ql <= qr) {
      double dst = hh[qq[ql]] + dis[x];
      if (dst >= 0) {
        ansx = x;
        ansy = hy[qq[ql]];
        FLG = 1;
        break;
      }
    }
    for (int i = head[x]; i; i = edge[i].nxt) {
      int y = edge[i].t;
      if (vis0[y] || vd[y]) continue;
      q.push(make_pair(y, d + 1));
    }
  }
  for (int i = 1; i <= ttot; ++i) vd[tmpt[i]] = 0;
}
void upd(int x, int pa, int dep) {
  cmxd = max(cmxd, dep);
  hh[dep] = max(hh[dep], dis[x]);
  if (hh[dep] == dis[x]) hy[dep] = x;
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (y == pa || vis0[y]) continue;
    upd(y, x, dep + 1);
  }
}
void dfs_c(int x) {
  vis0[x] = 1;
  dis[x] = 0;
  get_dis(x, 0);
  hh[0] = 0;
  cmxd = 0;
  hy[0] = x;
  for (int i = head[x]; i; i = edge[i].nxt) {
    int y = edge[i].t;
    if (vis0[y]) continue;
    get_ans(y);
    if (FLG) break;
    upd(y, x, 1);
  }
  for (int i = 0; i <= cmxd; ++i) hh[i] = -0x3f3f3f3f;
  if (FLG) return;
  for (auto y : dG[x]) dfs_c(y.second);
}
bool check() {
  FLG = 0;
  memset(vis0, 0, sizeof(vis0));
  dfs_c(RT);
  return FLG;
}
signed main() {
  read(n);
  read(D);
  read(U);
  for (int i = 1, u, v, w; i < n; ++i) {
    read(u);
    read(v);
    read(w);
    add_edge(u, v, w);
    add_edge(v, u, w);
  }
  lsh();
  DFT::Prep();
  for (int i = 0; i <= n; ++i) hh[i] = -0x3f3f3f3f;
  int l = 1, r = tat, mid;
  while (l < r) {
    mid = ((l + r + 1) >> 1);
    g = mid;
    if (check())
      l = mid;
    else
      r = mid - 1;
  }
  g = l;
  check();
  printf("%d %d\n", ansx, ansy);
  return 0;
}