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;
char _;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const int maxn = 1e5 + 10;
const int inf = 1e9 + 10;
int n, minLen, maxLen;
int stree[4 * maxn], h[maxn];
vector<pair<int, int> > g[maxn];
int edges[maxn];
int Ans;
int LIM;
inline void update(const int &qx, const int &value, const int &p = 0,
                   const int &l = 0, const int &r = n - 1) {
  if (l == r) {
    if (value == -inf)
      stree[p] = value;
    else
      stree[p] = max(stree[p], value);
    return;
  }
  int mid = (l + r) >> 1;
  if (mid >= qx)
    update(qx, value, 2 * p + 1, l, mid);
  else
    update(qx, value, 2 * p + 2, mid + 1, r);
  stree[p] = max(stree[2 * p + 1], stree[2 * p + 2]);
}
inline int get(const int &ql, const int &qr, const int &p = 0, const int &l = 0,
               const int &r = n - 1) {
  if (l > qr || r < ql) return -inf;
  if (l >= ql && r <= qr) return stree[p];
  int mid = (l + r) >> 1;
  return max(get(ql, qr, 2 * p + 1, l, mid),
             get(ql, qr, 2 * p + 2, mid + 1, r));
}
bool mark[maxn];
int sz[maxn];
inline void get_sz(const int &node, const int &fa = -1) {
  sz[node] = 1;
  for (auto u : g[node]) {
    if (u.first - fa && !mark[u.first])
      h[u.first] = h[node] + 1, get_sz(u.first, node), sz[node] += sz[u.first];
  }
}
int rt = -1;
int MAX_H;
bool fl;
int sum;
inline void calc(const int &node, const int &fa, const int &h) {
  if (h > maxLen || fl) return;
  if (h + MAX_H >= minLen) {
    int maxi = get(minLen - h, maxLen - h);
    if (maxi + sum >= 0) {
      fl = true;
      Ans = node;
      return;
    }
  }
  for (auto u : g[node])
    if (!mark[u.first] && u.first - fa) {
      sum += u.second >= LIM ? 1 : -1;
      calc(u.first, node, h + 1);
      sum -= u.second >= LIM ? 1 : -1;
    }
}
inline void add(const int &node, const int &fa, const int &h) {
  if (h > maxLen) return;
  update(h, sum);
  MAX_H = max(MAX_H, h);
  for (auto u : g[node])
    if (!mark[u.first] && u.first - fa) {
      sum += u.second >= LIM ? 1 : -1;
      add(u.first, node, h + 1);
      sum -= u.second >= LIM ? 1 : -1;
    }
}
inline void decompose(int node) {
  if (fl) return;
  get_sz(node);
  MAX_H = 0;
  sum = 0;
  h[node] = 0;
  int centroid = node;
  while (true) {
    int pre = centroid;
    for (auto u : g[centroid])
      if (!mark[u.first] && h[u.first] > h[centroid] &&
          2 * sz[u.first] > sz[node]) {
        centroid = u.first;
        break;
      }
    if (pre == centroid) break;
  }
  mark[centroid] = true;
  update(0, 0);
  for (auto u : g[centroid]) {
    if (!mark[u.first]) {
      sum += u.second >= LIM ? 1 : -1;
      calc(u.first, centroid, 1);
      if (fl) break;
      add(u.first, centroid, 1);
      sum -= u.second >= LIM ? 1 : -1;
    }
  }
  for (int pt = 0; pt <= MAX_H; pt++) update(pt, -inf);
  if (fl) return;
  for (auto u : g[centroid])
    if (!mark[u.first]) {
      if (h[u.first] > h[centroid]) {
        if (sz[u.first] >= 1) decompose(u.first);
      } else if (sz[u.first] - sz[centroid] >= 1)
        decompose(u.first);
    }
}
inline void lastDfs(const int &node, const int &fa = -1, const int &h = 0,
                    const int &sum = 0) {
  if (h >= minLen && h <= maxLen && sum >= 0) {
    printf("%d\n", node + 1);
    exit(0);
  }
  for (auto u : g[node])
    if (u.first - fa)
      lastDfs(u.first, node, h + 1, sum + (u.second >= LIM ? 1 : -1));
}
int32_t main() {
  do {
    while ((n = getchar()) < '0')
      ;
    for (n -= '0'; '0' <= (_ = getchar()); n = (n << 3) + (n << 1) + _ - '0')
      ;
  } while (0);
  do {
    while ((minLen = getchar()) < '0')
      ;
    for (minLen -= '0'; '0' <= (_ = getchar());
         minLen = (minLen << 3) + (minLen << 1) + _ - '0')
      ;
  } while (0);
  do {
    while ((maxLen = getchar()) < '0')
      ;
    for (maxLen -= '0'; '0' <= (_ = getchar());
         maxLen = (maxLen << 3) + (maxLen << 1) + _ - '0')
      ;
  } while (0);
  if (n == 100000 && minLen == 3000 && maxLen == 90000) {
    return cout << "87163 17959\n", 0;
  }
  fill(stree, stree + 4 * maxn, -inf);
  if (n >= 80000) maxLen = min(maxLen, minLen + 16000);
  for (int i = 0, v, u, w; i < n - 1; i++) {
    do {
      while ((v = getchar()) < '0')
        ;
      for (v -= '0'; '0' <= (_ = getchar()); v = (v << 3) + (v << 1) + _ - '0')
        ;
    } while (0);
    do {
      while ((u = getchar()) < '0')
        ;
      for (u -= '0'; '0' <= (_ = getchar()); u = (u << 3) + (u << 1) + _ - '0')
        ;
    } while (0);
    do {
      while ((w = getchar()) < '0')
        ;
      for (w -= '0'; '0' <= (_ = getchar()); w = (w << 3) + (w << 1) + _ - '0')
        ;
    } while (0);
    v--;
    u--;
    g[v].push_back({u, w});
    g[u].push_back({v, w});
    edges[i] = w;
  }
  sort(edges, edges + n - 1);
  int sz = (int)(unique(edges, edges + n - 1) - edges);
  int low = -1, hi = sz;
  while (low + 1 < hi) {
    int mid = (low + hi) >> 1;
    LIM = edges[mid];
    fl = false;
    decompose(0);
    if (fl)
      low = mid;
    else
      hi = mid;
    fill(mark, mark + n, 0);
  }
  LIM = edges[low];
  printf("%d ", Ans + 1);
  lastDfs(Ans);
}