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 = 1e5 + 20;
const int maxb = 18;
vector<int> adj[maxn], ord[maxb];
int sz[maxn], L, R, edge[maxb][maxn], h[maxb][maxn], s[maxn], seg[maxn * 4];
bool picked[maxn];
int n, from[maxn], to[maxn], c[maxn], w[maxn];
bitset<maxn> is[maxb], empt[maxb];
void plant(int v, int p = -1) {
  sz[v] = 1;
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (!picked[u] && u != p) plant(u, v), sz[v] += sz[u];
  }
}
int find_centroid(int v, int n, int p = -1) {
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (!picked[u] && u != p && sz[u] * 2 > n) return find_centroid(u, n, v);
  }
  return v;
}
void dfs(int v, int lvl, int p = -1) {
  ord[lvl].push_back(v);
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (!picked[u] && u != p) {
      h[lvl][u] = h[lvl][v] + 1;
      edge[lvl][u] = e;
      dfs(u, lvl, v);
    }
  }
}
void decompose(int v, int lvl) {
  plant(v);
  int n = sz[v];
  v = find_centroid(v, n);
  picked[v] = 1;
  ord[lvl].push_back(v);
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (!picked[u]) {
      h[lvl][u] = 1;
      edge[lvl][u] = e;
      dfs(u, lvl);
      is[lvl][ord[lvl].back()] = 1;
    }
  }
  ord[lvl].push_back(v);
  empt[lvl][v] = 1;
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (!picked[u]) decompose(u, lvl + 1);
  }
}
int get(int l, int r, int s, int e, int v) {
  if (l <= s && e <= r) return seg[v];
  if (r <= s || e <= l) return -maxn;
  int m = (s + e) / 2;
  return max(get(l, r, s, m, 2 * v), get(l, r, m, e, 2 * v + 1));
}
void update(int p, int val, int s, int e, int v) {
  while (e - s >= 2) {
    seg[v] = max(seg[v], val);
    int m = (s + e) / 2;
    if (p < m)
      e = m, v = 2 * v;
    else
      s = m, v = 2 * v + 1;
  }
  seg[v] = max(seg[v], val);
}
int ver;
bool check(int x) {
  for (int i = 0; i < n - 1; i++) w[i] = ((c[i] >= x) ? 1 : -1);
  for (int lvl = 0; !ord[lvl].empty(); lvl++) {
    for (auto v : ord[lvl]) {
      if (edge[lvl][v] >= 0)
        s[v] = s[from[edge[lvl][v]] ^ to[edge[lvl][v]] ^ v] + w[edge[lvl][v]];
      else
        s[v] = 0;
    }
    for (int i = 0; i < (int)ord[lvl].size(); i++) {
      int last = i + 1;
      while (!empt[lvl][ord[lvl][last - 1]]) last++;
      int m = (last - i + 1);
      fill(seg, seg + 4 * m, -maxn);
      int pt = i;
      for (int j = i; j < last; j++) {
        int v = ord[lvl][j];
        if (get(L - h[lvl][v], R - h[lvl][v] + 1, 0, m, 1) + s[v] >= 0) {
          ver = v;
          return 1;
        }
        if (is[lvl][v])
          while (pt <= j)
            update(h[lvl][ord[lvl][pt]], s[ord[lvl][pt]], 0, m, 1), pt++;
      }
      i = last - 1;
    }
  }
  return 0;
}
void handle(int v, int len = 0, int sum = 0, int p = -1) {
  if (L <= len && len <= R && sum >= 0) {
    cout << ver + 1 << " " << v + 1 << endl;
    exit(0);
  }
  for (auto e : adj[v]) {
    int u = from[e] ^ to[e] ^ v;
    if (u != p) handle(u, len + 1, sum + w[e], v);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(edge, -1, sizeof edge);
  cin >> n >> L >> R;
  vector<int> tmp;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b >> c[i];
    a--, b--;
    tmp.push_back(c[i]);
    adj[a].push_back(i);
    adj[b].push_back(i);
    from[i] = a, to[i] = b;
  }
  decompose(0, 0);
  sort(tmp.begin(), tmp.end());
  tmp.resize(unique(tmp.begin(), tmp.end()) - tmp.begin());
  int l = 0, r = tmp.size();
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (check(tmp[m]))
      l = m;
    else
      r = m;
  }
  check(tmp[l]);
  handle(ver);
}