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 = 100000 + 5;
const int inf = 1000000000 + 10;
int hide[N], sz[N], par[N], h[N], hp[N], ew[N], vec[N], seg[4 * N], L, R, ptr,
    mx_med = -1, pth, nxt;
vector<pair<int, int> > adj[N];
vector<int> W;
void reset(int l = 0, int r = ptr + 1, int id = 1) {
  seg[id] = -inf;
  if (r - l == 1) return;
  int mid = (l + r) >> 1;
  reset(l, mid, (id << 1));
  reset(mid, r, (id << 1 | 1));
}
void modify(int p, int val, int l = 0, int r = ptr + 1, int id = 1) {
  if (r - l == 1) {
    seg[id] = max(seg[id], val);
    return;
  }
  int mid = (l + r) >> 1;
  if (p < mid)
    modify(p, val, l, mid, (id << 1));
  else
    modify(p, val, mid, r, (id << 1 | 1));
  seg[id] = max(seg[(id << 1)], seg[(id << 1 | 1)]);
}
int get(int l, int r, int s = 0, int e = ptr + 1, int id = 1) {
  if (e <= l || r <= s) return -inf;
  if (l <= s && e <= r) return seg[id];
  int mid = (s + e) >> 1;
  return max(get(l, r, s, mid, (id << 1)), get(l, r, mid, e, (id << 1 | 1)));
}
void preDFS(int v, int p = 0) {
  sz[v] = 1;
  for (pair<int, int> e : adj[v])
    if (e.first != p && !hide[e.first])
      preDFS(e.first, v), sz[v] += sz[e.first];
}
void DFS(int v, int p = 0) {
  par[v] = p;
  for (pair<int, int> e : adj[v]) {
    if (e.first != p && !hide[e.first]) {
      vec[ptr++] = e.first;
      h[e.first] = h[v] + 1;
      ew[e.first] = e.second;
      DFS(e.first, v);
    }
  }
}
void pthDFS(int v, int p = 0, int H = 0, int Hp = 0) {
  if (L <= H && H <= R && 0 <= Hp) nxt = v;
  for (pair<int, int> e : adj[v])
    if (e.first != p)
      pthDFS(e.first, v, H + 1, Hp + (mx_med <= e.second ? 1 : -1));
}
int findCentroid(int v, int t, int p = 0) {
  bool f = true;
  while (f) {
    f = false;
    for (pair<int, int> e : adj[v])
      if (e.first != p && !hide[e.first] && t < 2 * sz[e.first]) {
        p = v;
        v = e.first;
        f = true;
        break;
      }
  }
  return v;
}
void solve(int v) {
  preDFS(v);
  v = findCentroid(v, sz[v]);
  ptr = 0;
  h[v] = 0;
  DFS(v, 0);
  hp[v] = 0;
  int l = -1, r = ((int)(W.size()));
  while (1 < r - l) {
    int mid = (l + r) >> 1;
    for (int i = 0; i < ptr; i++)
      hp[vec[i]] = hp[par[vec[i]]] + (W[mid] <= ew[vec[i]] ? 1 : -1);
    reset();
    modify(0, 0);
    int last = 0, find = 0;
    for (int i = 0; i < ptr; i++) {
      int u = vec[i];
      if (h[u] == 1) {
        for (int j = last; j < i; j++) modify(h[vec[j]], hp[vec[j]]);
        last = i;
      }
      int lp = max(0, L - h[u]);
      int rp = max(0, R - h[u] + 1);
      if (0 <= hp[u] + get(lp, rp)) {
        find = 1;
        if (mx_med < W[mid]) {
          mx_med = W[mid];
          pth = u;
        }
        break;
      }
    }
    if (find)
      l = mid;
    else
      r = mid;
  }
  hide[v] = 1;
  for (pair<int, int> e : adj[v])
    if (!hide[e.first]) solve(e.first);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n >> L >> R;
  for (int i = 1; i < n; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    adj[u].push_back(make_pair(v, w));
    adj[v].push_back(make_pair(u, w));
    W.push_back(w);
  }
  sort(W.begin(), W.end());
  W.resize(unique(W.begin(), W.end()) - W.begin());
  solve(1);
  pthDFS(pth);
  cout << pth << ' ' << nxt;
  return 0;
}