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 N = 1 << 17;
const int INF = 1e9 + 9;
int tmax[2 * N];
int n, h[N], d[N], par[N], root[N];
int argmax(int v, int u) {
  if (v == -1) {
    return u;
  }
  if (u == -1) {
    return v;
  }
  return root[v] > root[u] ? v : u;
}
int query(int l, int r) {
  l = max(l, 0);
  r = min(r, N - 1);
  int res = -1;
  for (l += N, r += N; l <= r; l /= 2, r /= 2) {
    if (l % 2 == 1) {
      res = argmax(res, tmax[l++]);
    }
    if (r % 2 == 0) {
      res = argmax(res, tmax[r--]);
    }
  }
  return res;
}
void update(int i, int vertex) {
  i += N;
  tmax[i] = vertex;
  for (i /= 2; i > 0; i /= 2) {
    tmax[i] = argmax(tmax[i + i], tmax[i + i + 1]);
  }
}
void clear(int l, int r) {
  for (int i = l; i <= r; ++i) {
    update(i, -1);
  }
}
vector<pair<int, int>> g[N];
vector<int> vec[N], t[N];
void predfs(int v) {
  queue<int> q;
  h[v] = 1;
  q.push(v);
  while (q.size()) {
    v = q.front();
    q.pop();
    for (auto u : g[v]) {
      if (!h[u.first]) {
        h[u.first] = h[v] + 1;
        t[v].push_back(u.first);
        q.push(u.first);
      } else {
        par[v] = u.second;
      }
    }
  }
  vector<int> ord(n);
  iota(ord.begin(), ord.end(), 0);
  sort(ord.begin(), ord.end(), [&](int vv, int uu) { return h[vv] > h[uu]; });
  for (int vv : ord) {
    for (int uu : t[vv]) {
      d[vv] = max(d[vv], d[uu] + 1);
    }
  }
}
int median, minlen, maxlen;
int ansv, ansu;
void solve(int v, bool clean) {
  if (t[v].empty()) {
    vec[v] = {v};
    if (!clean) {
      update(h[v], v);
    }
    return;
  }
  for (int ind = 1; ind < (int)t[v].size(); ++ind) {
    solve(t[v][ind], true);
  }
  solve(t[v][0], false);
  vec[v].clear();
  swap(vec[v], vec[t[v][0]]);
  vec[v].push_back(v);
  int help = (int)vec[v].size() - 1;
  for (int ind = 1; ind < (int)t[v].size(); ++ind) {
    const vector<int> &elem = vec[t[v][ind]];
    for (int i = 0; i < (int)elem.size(); ++i) {
      int lef = minlen - i - 1 + h[v], rig = maxlen - i - 1 + h[v];
      int u1 = elem[elem.size() - 1 - i];
      int u2 = query(lef, rig);
      if (u2 != -1) {
        int cursum = root[u1] + root[u2] - 2 * root[v];
        if (cursum >= 0) {
          ansv = u1;
          ansu = u2;
        }
      }
    }
    for (int i = 0; i < (int)elem.size(); ++i) {
      int u = elem[i];
      update(h[u], argmax(tmax[N + h[u]], u));
      int pos = h[u] - h[v];
      assert(d[u] < d[v]);
      assert(0 <= pos && pos < (int)vec[v].size());
      vec[v][help - pos] = argmax(vec[v][help - pos], u);
    }
  }
  int lef = minlen + h[v], rig = maxlen + h[v];
  int u2 = query(lef, rig);
  if (u2 != -1) {
    int cursum = root[u2] - root[v];
    if (cursum >= 0) {
      ansv = v;
      ansu = u2;
    }
  }
  vec[v][help] = v;
  update(h[v], argmax(tmax[N + h[v]], v));
  if (clean) {
    clear(h[v], h[v] + d[v]);
  }
}
void subdfs(int v) {
  queue<int> q;
  q.push(v);
  while (q.size()) {
    v = q.front();
    q.pop();
    for (int u : t[v]) {
      root[u] = root[v] + 2 * (par[u] >= median) - 1;
      q.push(u);
    }
  }
}
bool check() {
  ansv = -1;
  ansu = -1;
  root[0] = 0;
  subdfs(0);
  solve(0, true);
  return ansv != -1;
}
signed main() {
  ios::sync_with_stdio(0), cin.tie(0);
  fill_n(tmax, 2 * N, -1);
  cin >> n >> minlen >> maxlen;
  assert(n >= 2);
  vector<int> sorted;
  for (int v, u, c, i = 0; i < n - 1; ++i) {
    cin >> v >> u >> c;
    --v;
    --u;
    g[v].emplace_back(u, c);
    g[u].emplace_back(v, c);
    sorted.push_back(c);
  }
  sort(sorted.begin(), sorted.end());
  h[0] = 1;
  predfs(0);
  for (int i = 0; i < n; ++i) {
    sort(t[i].begin(), t[i].end(), [&](int v, int u) { return d[v] > d[u]; });
  }
  int lef = 0, rig = (int)sorted.size();
  while (rig - lef > 1) {
    int mid = (lef + rig) / 2;
    median = sorted[mid];
    if (check()) {
      lef = mid;
    } else {
      rig = mid;
    }
  }
  median = sorted[lef];
  assert(check());
  cout << ansv + 1 << " " << ansu + 1 << "\n";
  return 0;
}