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>
inline int getint() {
  int x = 0, p = 1;
  char c;
  c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int maxn = 1e5 + 5;
const int base = 1e5 + 5;
int n, L, R, ison[maxn], res[2], m = 1;
vector<int> E;
vector<pair<int, int> > G[maxn];
vector<pair<int, pair<int, int> > > vv;
bool is_centroid[maxn];
namespace T {
pair<int, int> dat[maxn << 2];
inline void finit(int _n) {
  m = 1;
  while (m < _n) m <<= 1;
  for (int(i) = 0; (i) < (2 * m - 1); (i)++)
    dat[i] = make_pair(-1000000000, -1);
}
inline void fM(int x, pair<int, int> del) {
  x += m - 1;
  if (del > dat[x]) {
    dat[x] = max(dat[x], del);
    while (x > 0) {
      x = (x - 1) / 2;
      dat[x] = max(dat[2 * x + 1], dat[2 * x + 2]);
    }
  }
}
pair<int, int> fQ(int x, int y, int l, int r, int k) {
  if (y <= l || x >= r || x >= y)
    return make_pair(-1000000000, -1);
  else if (x <= l && r <= y)
    return dat[k];
  else {
    pair<int, int> lx = fQ(x, y, l, (l + r) >> 1, 2 * k + 1);
    pair<int, int> ly = fQ(x, y, (l + r) >> 1, r, 2 * k + 2);
    return max(lx, ly);
  }
}
}  // namespace T
pair<int, pair<int, int> > get_ans(int x, int p, int len, int ok, int val) {
  pair<int, int> buf = T::fQ(max(L - len, 0), min(R - len + 1, m), 0, m, 0);
  pair<int, pair<int, int> > ans =
      make_pair(buf.first + ok, make_pair(buf.second, x));
  if (ans.first >= 0)
    return ans;
  else {
    vv.push_back(make_pair(len, make_pair(ok, x)));
    if (len + 1 > R) return make_pair(-1000000000, make_pair(-1000000000, -1));
    for (int(i) = 0; (i) < (G[x].size()); (i)++) {
      int y = G[x][i].second, llen = G[x][i].first;
      if (y == p || is_centroid[y]) continue;
      ans = get_ans(y, x, len + 1, ok + ((llen >= val) ? 1 : -1), val);
      if (ans.first >= 0) return ans;
    }
  }
  return make_pair(-1000000000, make_pair(-1000000000, -1));
}
int cnt_son(int x, int p) {
  int c = 1;
  for (int(i) = 0; (i) < (G[x].size()); (i)++) {
    int y = G[x][i].second;
    if (y == p || is_centroid[y]) continue;
    c += cnt_son(y, x);
  }
  return ison[x] = c;
}
pair<int, int> get_centroid(int x, int p, int tot) {
  pair<int, int> ans = make_pair(1000000000, -1);
  int c = 0, ileft = 1;
  for (int(i) = 0; (i) < (G[x].size()); (i)++) {
    int y = G[x][i].second;
    if (y == p || is_centroid[y]) continue;
    ans = min(ans, get_centroid(y, x, tot));
    ileft += ison[y];
    c = max(c, ison[y]);
  }
  c = max(c, tot - ileft);
  ans = min(ans, make_pair(c, x));
  return ans;
}
pair<int, pair<int, int> > work(int x, int val) {
  cnt_son(x, -1);
  pair<int, int> u = get_centroid(x, -1, ison[x]);
  int tot = u.first, s = u.second;
  is_centroid[s] = true;
  for (int(i) = 0; (i) < (G[s].size()); (i)++) {
    int y = G[s][i].second;
    if (is_centroid[y]) continue;
    pair<int, pair<int, int> > ans = work(y, val);
    if (ans.first >= 0) return ans;
  }
  T::finit(tot + 1);
  T::fM(0, make_pair(0, s));
  for (int(i) = 0; (i) < (G[s].size()); (i)++) {
    vv.clear();
    int y = G[s][i].second, len = G[s][i].first;
    if (is_centroid[y]) continue;
    pair<int, pair<int, int> > ans =
        get_ans(y, s, 1, ((len >= val) ? 1 : -1), val);
    if (ans.first >= 0) return ans;
    for (int(i) = 0; (i) < (vv.size()); (i)++)
      T::fM(vv[i].first, make_pair(vv[i].second.first, vv[i].second.second));
  }
  is_centroid[s] = false;
  return make_pair(-1000000000, make_pair(-1, -1));
}
int main() {
  n = getint();
  L = getint();
  R = getint();
  for (int(i) = 0; (i) < (n - 1); (i)++) {
    int x, y, z;
    x = getint();
    y = getint();
    z = getint();
    x--;
    y--;
    G[x].push_back(make_pair(z, y));
    G[y].push_back(make_pair(z, x));
    E.push_back(z);
  }
  sort(E.begin(), E.end());
  E.resize(unique(E.begin(), E.end()) - E.begin());
  int lb = 0, rb = E.size();
  if (rb - lb == 1) {
    pair<int, int> ans = work(0, E[0]).second;
    res[0] = ans.first;
    res[1] = ans.second;
  } else
    while (rb - lb > 1) {
      int mid = (lb + rb) >> 1;
      int val = E[mid];
      memset(is_centroid, 0, sizeof(is_centroid));
      pair<int, pair<int, int> > ans = work(0, val);
      if (ans.first >= 0) {
        lb = mid;
        res[0] = ans.second.first;
        res[1] = ans.second.second;
      } else
        rb = mid;
    }
  for (int(i) = 0; (i) < (2); (i)++) printf("%d ", res[i] + 1);
  return 0;
}