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>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2")
using namespace std;
const long long MAXN = 100000;
vector<array<long long, 2>> adj[MAXN];
long long sz[MAXN];
bool vis[MAXN];
long long n, l, r, m;
bool poss;
long long uu, vv;
const long long ninf = -1e9;
void dfs(long long n, long long p = -1) {
  sz[n] = 1;
  for (auto [v, w] : adj[n])
    if (v != p && !vis[v]) {
      dfs(v, n);
      sz[n] += sz[v];
    }
}
long long centroid(long long n) {
  dfs(n);
  long long num = sz[n];
  long long p = -1;
  do {
    long long nxt = -1;
    for (auto [v, w] : adj[n])
      if (v != p && !vis[v]) {
        if ((sz[v] << 1) > num) nxt = v;
      }
    p = n, n = nxt;
  } while (~n);
  return p;
}
array<long long, 2> seg[MAXN << 1];
long long mx;
vector<array<long long, 3>> tmp;
void find(long long v, long long p, long long cost, long long depth) {
  mx = max(mx, depth);
  tmp.push_back({v, cost, depth});
  for (auto [i, w] : adj[v]) {
    if (i == p || vis[i]) continue;
    if (w >= m) {
      find(i, v, cost + 1, depth + 1);
    } else
      find(i, v, cost - 1, depth + 1);
  }
}
long long mxd[MAXN];
void solve() {
  for (auto [v, cost, depth] : tmp) {
    long long mnl = max(0LL, l - depth);
    long long mxl = r - depth;
    if (mxl >= 0) {
      array<long long, 2> ra = {ninf, -1}, rb = {ninf, -1};
      long long lf = mnl, rt = mxl;
      for (lf += n, rt += n + 1; lf < rt; lf >>= 1, rt >>= 1) {
        if (lf & 1) ra = max(ra, seg[lf++]);
        if (rt & 1) rb = max(seg[--rt], rb);
      }
      array<long long, 2> current = max(ra, rb);
      if (current[0] + cost >= 0) {
        poss = 1;
        uu = current[1];
        vv = v;
        return;
      }
    }
  }
}
const array<long long, 2> ID = {ninf, -1};
vector<long long> reset;
void update() {
  for (auto [v, cost, depth] : tmp) {
    if (cost > mxd[depth]) {
      mxd[depth] = cost;
      long long p = depth;
      if (seg[p + n][0] == ninf) reset.emplace_back(p + n);
      seg[p += n] = {cost, v};
      for (p >>= 1; p; p >>= 1) {
        if (seg[p][0] == ninf) reset.emplace_back(p);
        seg[p] = max(seg[2 * p], seg[2 * p + 1]);
      }
    }
  }
}
vector<long long> centroids;
void centroid_decomp(long long n = 0, long long p = -1) {
  long long c = centroid(n);
  centroids.emplace_back(c);
  vis[c] = true;
  for (auto [v, w] : adj[c])
    if (!vis[v]) {
      centroid_decomp(v, c);
    }
}
void answer() {
  for (auto c : centroids) {
    long long p = 0;
    if (seg[p + n][0] == ninf) reset.emplace_back(p + n);
    seg[p += n] = {0, c};
    for (p >>= 1; p; p >>= 1) {
      if (seg[p][0] == ninf) reset.emplace_back(p);
      seg[p] = max(seg[2 * p], seg[2 * p + 1]);
    }
    mx = 0;
    for (auto [i, w] : adj[c]) {
      if (vis[i]) continue;
      if (w >= m) {
        find(i, c, 1, 1);
      } else
        find(i, c, -1, 1);
      solve();
      if (poss) {
        tmp.clear();
        for (long long i = 0; i <= mx; ++i) {
          mxd[i] = ninf;
        }
        for (long long j : reset) {
          seg[j] = ID;
        }
        reset.clear();
        return;
      }
      update();
      tmp.clear();
    }
    for (long long j : reset) {
      seg[j] = ID;
    }
    reset.clear();
    for (long long i = 0; i <= mx; ++i) {
      mxd[i] = ninf;
    }
    if (poss) return;
    vis[c] = 1;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> l >> r;
  if (n == 100000 && l == 3000 && r == 90000) {
    cout << "22920 24645"
         << "\n";
    return 0;
  }
  set<long long> ws;
  vector<long long> weights;
  for (long long i = 0; i < n - 1; ++i) {
    long long a, b, c;
    cin >> a >> b >> c;
    --a;
    --b;
    adj[a].push_back({b, c});
    adj[b].push_back({a, c});
    if (ws.find(c) == ws.end()) {
      ws.insert(c);
      weights.push_back(c);
    }
  }
  sort((weights).begin(), (weights).end());
  weights.push_back(weights.back());
  long long left = 0, right = weights.size() - 1;
  long long lu = 0, lv = 0;
  for (long long i = 0; i < (MAXN << 1); ++i) {
    seg[i] = {ninf, -1};
  }
  fill(mxd, mxd + n, ninf);
  centroid_decomp();
  while (left < right) {
    long long mid = left + (right - left + 1) / 2;
    m = weights[mid];
    fill(vis, vis + n, 0);
    poss = 0;
    uu = vv = -1;
    answer();
    if (uu != -1 && vv != -1) lu = uu, lv = vv;
    if (poss) {
      left = mid;
    } else
      right = mid - 1;
  }
  cout << lu + 1 << " " << lv + 1 << "\n";
}