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 inf = 2000000000;
const int N = 1e5 + 5;
bool ok = false;
int mid, lx, ly, first, second, n, down, up, level[N];
vector<pair<int, int>> g[N];
int dfs(int v, int size, int &center, int pr = 0) {
  int sum = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i].first;
    if (to != pr && level[to] == -1) {
      sum += dfs(to, size, center, v);
    }
  }
  if (center == -1 && sum >= size / 2) {
    center = v;
  }
  return sum;
}
void dfscalc(int v, int sum, int len, vector<pair<int, int>> &cur,
             int pr = -1) {
  if (len > cur.size()) {
    cur.push_back(make_pair(sum, v));
  } else {
    if (sum > cur[len - 1].first) {
      cur[len - 1] = make_pair(sum, v);
    }
  }
  if (len < up) {
    for (int i = 0; i < g[v].size(); i++) {
      int to = g[v][i].first;
      int val = (g[v][i].second >= mid ? 1 : -1);
      if (to != pr && level[to] == -1) {
        dfscalc(to, sum + val, len + 1, cur, v);
      }
    }
  }
}
bool cmp(vector<pair<int, int>> &a, vector<pair<int, int>> &b) {
  return (a.size() < b.size());
}
void upd(pair<int, int> tree[], int first, pair<int, int> second) {
  if (second.first > tree[first].first) {
    tree[first] = second;
  }
  while (first > 1) {
    first >>= 1;
    if (tree[first + first].first > tree[first + first + 1].first) {
      tree[first] = tree[first + first];
    } else {
      tree[first] = tree[first + first + 1];
    }
  }
}
pair<int, int> getmax(pair<int, int> tree[], int v, int lv, int rv, int l,
                      int r) {
  if (lv > r || rv < l) {
    return {-inf, -1};
  }
  if (lv >= l && rv <= r) {
    return tree[v];
  }
  int mid = (lv + rv) / 2;
  pair<int, int> q = getmax(tree, v + v, lv, mid, l, r);
  pair<int, int> w = getmax(tree, v + v + 1, mid + 1, rv, l, r);
  if (q.first > w.first) {
    return q;
  } else {
    return w;
  }
}
void calc(int v, int size) {
  vector<vector<pair<int, int>>> a;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i].first;
    int val = g[v][i].second >= mid ? 1 : -1;
    if (level[to] == -1) {
      vector<pair<int, int>> cur;
      dfscalc(to, val, 1, cur, v);
      a.push_back(cur);
    }
  }
  if (a.size() == 0) {
    return;
  }
  int treesize = size;
  int sz = 1;
  while (sz < treesize) {
    sz <<= 1;
  }
  pair<int, int> tree[2 * sz];
  for (int i = 1; i < 2 * sz; i++) {
    tree[i] = {-inf, -1};
  }
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j < a[i].size(); j++) {
      int len = j + 1;
      if (a[i][j].first >= 0) {
        if (len >= down && len <= up) {
          ok = true;
          first = v;
          second = a[i][j].second;
          return;
        }
      }
      if (len < up && a.size() > 1) {
        pair<int, int> tmp =
            getmax(tree, 1, 1, sz, max(1, down - len), up - len);
        if (a[i][j].first + tmp.first >= 0) {
          ok = true;
          first = tmp.second;
          second = a[i][j].second;
          return;
        }
      }
    }
    if (a.size() > 1) {
      for (int j = 0; j < a[i].size(); j++) {
        int len = j + 1;
        upd(tree, len + sz - 1, {a[i][j].first, a[i][j].second});
      }
    }
  }
}
void build(int v, int depth = 1) {
  int tmp = 0, center = -1;
  int size = dfs(v, 0, tmp);
  dfs(v, size, center);
  level[center] = depth;
  calc(center, size / 2 + 1);
  for (int i = 0; i < g[center].size() && !ok; i++) {
    int to = g[center][i].first;
    if (level[to] == -1) {
      build(to, depth + 1);
    }
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> down >> up;
  int mx = 0;
  for (int i = 1; i < n; i++) {
    int q, w, c;
    cin >> q >> w >> c;
    g[q].push_back(make_pair(w, c));
    g[w].push_back(make_pair(q, c));
    mx = max(mx, c);
  }
  int l = 0;
  int r = mx;
  int lx, ly;
  while (l <= r) {
    memset(level, -1, sizeof(level));
    mid = (l + r) / 2;
    ok = false;
    build(1);
    if (ok) {
      l = mid + 1;
      lx = first;
      ly = second;
    } else {
      r = mid - 1;
    }
  }
  cout << lx << " " << ly << "\n";
}