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 + 10;
const int MAXT = (1 << 20);
bool mark[MAXN];
int n, l, r, N, C, lim, lenHave, now;
int a[MAXN], b[MAXN], c[MAXN], sz[MAXN], val[MAXN], dp[MAXT], cent[MAXN];
vector<int> adj[MAXN], wei[MAXN], adjF[MAXN], weiF[MAXN], perm[MAXN],
    child[MAXN];
pair<int, int> have[MAXN];
void add(int root, int lo, int hi, int pos, int wh) {
  while (true) {
    if (dp[root] == -1 || val[dp[root]] < val[pos]) dp[root] = pos;
    if (lo == hi) return;
    int mid = (lo + hi) / 2;
    if (wh <= mid)
      root = root * 2, hi = mid;
    else
      root = root * 2 + 1, lo = mid + 1;
  }
}
int get(int root, int lo, int hi, int st, int fn) {
  if (hi < st || fn < lo) return -1;
  if (st <= lo && hi <= fn) return dp[root];
  int mid = (lo + hi) / 2;
  int f1 = get((root << 1), lo, mid, st, fn);
  int f2 = get((root << 1) + 1, mid + 1, hi, st, fn);
  if (f1 == -1 || f2 == -1) return max(f1, f2);
  return (val[f1] < val[f2]) ? f2 : f1;
}
pair<int, int> dfs(const int &v, const int &h, const int &cost) {
  mark[v] = true;
  val[v] = cost;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    if (!mark[adj[v][i]]) {
      if (v == C) {
        for (int j = 0; j < lenHave; j++)
          add(1, 0, N, have[j].second, have[j].first);
        lenHave = 0;
      }
      pair<int, int> ret =
          dfs(adj[v][i], h + 1, cost + ((wei[v][i] < lim) ? -1 : 1));
      if (ret != pair<int, int>(-1, -1)) return ret;
    } else if (h == 1) {
      swap(adj[v][(int)adj[v].size() - 1], adj[v][i]);
      swap(wei[v][(int)wei[v].size() - 1], wei[v][i]);
      adj[v].pop_back();
      wei[v].pop_back();
      i--;
    }
  }
  if (v == C) return pair<int, int>(-1, -1);
  have[lenHave++] = pair<int, int>(h, v);
  int pos = get(1, 0, N, l - h, r - h);
  if (pos != -1 && 0 <= val[pos] + cost) return pair<int, int>(v, pos);
  return pair<int, int>(-1, -1);
}
pair<int, int> go(int ind) {
  N = (int)perm[ind].size();
  for (int i = 0; i <= 20; i++)
    if (((int)perm[ind].size() + 1) <= (1 << i)) {
      for (int j = 1; j <= (1 << (i + 1)); j++) dp[j] = -1;
      break;
    }
  C = cent[ind];
  val[C] = 0;
  lenHave = 0;
  add(1, 0, N, C, 0);
  for (int i = 0; i < (int)perm[ind].size(); i++) mark[perm[ind][i]] = false;
  pair<int, int> ret = dfs(C, 0, 0);
  if (ret != pair<int, int>(-1, -1)) return ret;
  for (int i = 0; i < (int)child[ind].size(); i++) {
    pair<int, int> ret = go(child[ind][i]);
    if (ret != pair<int, int>(-1, -1)) return ret;
  }
  return pair<int, int>(-1, -1);
}
int findCenter(int v) {
  mark[v] = true;
  sz[v] = 1;
  int maxi = 0;
  for (int i = 0; i < (int)adj[v].size(); i++)
    if (!mark[adj[v][i]]) {
      int ret = findCenter(adj[v][i]);
      if (ret != -1) return ret;
      sz[v] += sz[adj[v][i]];
      maxi = max(maxi, sz[adj[v][i]]);
    }
  if (max(maxi, N - sz[v]) * 2 <= N) return v;
  return -1;
}
void dfs2(int v, int h) {
  if (h == 1) now++;
  mark[v] = true;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    if (!mark[adj[v][i]])
      dfs2(adj[v][i], h + 1);
    else if (h == 1) {
      swap(adj[v][i], adj[v][(int)adj[v].size() - 1]);
      swap(wei[v][i], wei[v][(int)wei[v].size() - 1]);
      wei[v].pop_back();
      adj[v].pop_back();
      i--;
    }
  }
  if (h > 0) perm[now].push_back(v);
}
void build(int cur) {
  if (cur == 1) {
    now = 1;
    for (int i = 1; i <= n; i++) perm[cur].push_back(i);
  }
  N = (int)perm[cur].size();
  for (int i = 0; i < (int)perm[cur].size(); i++) mark[perm[cur][i]] = 0;
  cent[cur] = findCenter(perm[cur][0]);
  for (int i = 0; i < (int)perm[cur].size(); i++) mark[perm[cur][i]] = 0;
  int first = now + 1;
  dfs2(cent[cur], 0);
  for (int i = first; i <= now; i++) child[cur].push_back(i);
  for (int i = 0; i < (int)child[cur].size(); i++) build(child[cur][i]);
}
int main() {
  cin >> n >> l >> r;
  vector<int> store;
  for (int i = 1; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i];
    adjF[a[i]].push_back(b[i]);
    adjF[b[i]].push_back(a[i]);
    weiF[a[i]].push_back(c[i]);
    weiF[b[i]].push_back(c[i]);
    store.push_back(c[i]);
  }
  sort(store.begin(), store.end());
  store.resize(unique(store.begin(), store.end()) - store.begin());
  int lo = 0, hi = (int)store.size() - 1;
  pair<int, int> res = pair<int, int>(-1, -1);
  for (int i = 1; i <= n; i++) adj[i] = adjF[i], wei[i] = weiF[i];
  build(1);
  while (lo <= hi) {
    for (int i = 1; i <= n; i++) adj[i] = adjF[i], wei[i] = weiF[i];
    int mid = (lo + hi) / 2;
    ::lim = store[mid];
    pair<int, int> ret = go(1);
    if (ret != pair<int, int>(-1, -1)) {
      res = ret;
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  cout << res.first << ' ' << res.second << endl;
  return 0;
}