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 = 100005;
int n, l, r, v, root, medianValue;
int a, b, c;
bool visited[N], visited2[N];
int ans[N];
vector<int> W;
pair<int, int> PATH;
struct node {
  int p;
  vector<int> c;
  vector<int> w;
  int h;
  int nchild;
  int cost;
} T[N], TD[N];
int depth_, depth;
int calChild(int u) {
  int r = 0;
  visited[u] = true;
  if (T[u].c.size() == 0) return 0;
  int nc = 0;
  int maxh = 0;
  for (int i = 0; i < T[u].c.size(); i++) {
    v = T[u].c[i];
    if (visited[v] or visited2[v]) continue;
    nc += calChild(v) + 1;
  }
  T[u].nchild = nc;
  visited[u] = false;
  return nc;
}
int centroid(int u) {
  int n_ = T[u].nchild + 1;
  while (1) {
    int spe = -1;
    for (int i = 0; i < T[u].c.size(); i++) {
      v = T[u].c[i];
      if (T[v].nchild > T[u].nchild or visited2[v]) continue;
      if (T[v].nchild + 1 > n_ / 2) {
        spe = v;
        break;
      }
    }
    if (spe == -1) {
      break;
    } else
      u = spe;
  }
  return u;
}
int centroiDe(int u) {
  int r = centroid(u);
  visited2[r] = true;
  for (int i = 0; i < T[r].c.size(); i++) {
    int v = T[r].c[i];
    if (visited2[v]) continue;
    if (T[u].nchild < T[v].nchild) calChild(v);
    int x = centroiDe(v);
    TD[r].c.push_back(x);
    TD[x].p = r;
  }
  return r;
}
vector<int> bfs(int r) {
  queue<int> Q;
  vector<int> list;
  Q.push(r);
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    list.push_back(u);
    visited[u] = true;
    for (int i = 0; i < T[u].c.size(); i++) {
      v = T[u].c[i];
      if (!visited[v] and !visited2[v]) {
        T[v].p = u;
        T[v].h = T[u].h + 1;
        T[v].cost = T[u].cost + ((T[u].w[i] < medianValue) ? -1 : +1);
        Q.push(v);
      }
    }
  }
  for (int i = 0; i < list.size(); i++) visited[list[i]] = false;
  return list;
}
int delta;
int ITsize;
pair<int, int> IT[4 * N];
const pair<int, int> NONE = pair<int, int>(-1e9, -1);
void build(int n) {
  ITsize = ++n;
  for (delta = 1; delta < n; delta <<= 1)
    ;
  for (int i = 0; i <= n + delta; ++i) {
    IT[i] = NONE;
  }
}
void update(int n, pair<int, int> val) {
  for (n += delta; n > 0 && val > IT[n]; n >>= 1) IT[n] = val;
}
pair<int, int> query(int a, int b) {
  if (b < 0 || a > b) return NONE;
  a = max(a, 0);
  b = min(b, ITsize - 1);
  pair<int, int> ret = NONE;
  for (a += delta, b += delta; a <= b; a >>= 1, b >>= 1) {
    if (a & 1) {
      ret = max(ret, IT[a]);
      ++a;
    }
    if (~b & 1) {
      ret = max(ret, IT[b]);
      --b;
    }
  }
  return ret;
}
int maxlengthPath[N];
int MLP;
int computeMaxlengthPath_(int u) {
  visited[u] = true;
  int d = 0;
  for (int i = 0; i < T[u].c.size(); ++i) {
    int v = T[u].c[i];
    if (visited[v] or visited2[v]) continue;
    int t = computeMaxlengthPath_(v) + 1;
    MLP = max(MLP, d + t);
    d = max(d, t);
  }
  visited[u] = false;
  return d;
}
void computeMaxlengthPath(int u) {
  MLP = 0;
  int m = computeMaxlengthPath_(u);
  maxlengthPath[u] = MLP;
  visited2[u] = true;
  for (int i = 0; i < TD[u].c.size(); i++) {
    v = TD[u].c[i];
    if (visited2[v]) continue;
    computeMaxlengthPath(v);
  }
}
bool isExistPath(int u) {
  if (maxlengthPath[u] < l) return false;
  build(maxlengthPath[u] + 5);
  update(0, pair<int, int>(0, u));
  visited2[u] = true;
  update(0, pair<int, int>(0, u));
  for (int i = 0; i < T[u].c.size(); i++) {
    v = T[u].c[i];
    if (visited2[v]) continue;
    T[v].h = 1;
    T[v].cost = (T[u].w[i] < medianValue) ? -1 : 1;
    vector<int> listvChild = bfs(v);
    for (int j = 0; j < listvChild.size(); j++) {
      int vc = listvChild[j];
      pair<int, int> best = query(l - T[vc].h, r - T[vc].h);
      if (best.first + T[vc].cost >= 0) {
        PATH = pair<int, int>(vc, best.second);
        visited2[u] = false;
        return true;
      }
    }
    for (int j = 0; j < listvChild.size(); j++) {
      int vc = listvChild[j];
      update(T[vc].h, pair<int, int>(T[vc].cost, vc));
    }
  }
  for (int i = 0; i < TD[u].c.size(); i++) {
    v = TD[u].c[i];
    if (visited2[v]) continue;
    if (isExistPath(v)) {
      visited2[u] = false;
      return true;
    }
  }
  visited2[u] = false;
  return false;
}
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i < n; i++) {
    cin >> a >> b >> c;
    T[a].c.push_back(b);
    T[a].w.push_back(c);
    T[b].c.push_back(a);
    T[b].w.push_back(c);
    W.push_back(c);
  }
  calChild(1);
  root = centroid(1);
  calChild(root);
  centroiDe(root);
  fill(visited2 + 1, visited2 + n + 1, false);
  computeMaxlengthPath(root);
  fill(visited2 + 1, visited2 + n + 1, false);
  sort(W.begin(), W.end());
  int lo = 0;
  int hi = unique(W.begin(), W.end()) - W.begin() - 1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    medianValue = W[mid];
    if (isExistPath(root))
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  medianValue = W[lo - 1];
  isExistPath(root);
  cout << PATH.first << " " << PATH.second;
}