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>
template <typename T>
T max(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
T min(T a, T b) {
  return a > b ? b : a;
}
template <typename T>
void Swap(T &a, T &b) {
  T c = a;
  a = b;
  b = c;
}
template <typename T>
inline void read(T &res) {
  res = 0;
  T opt = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') opt = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    res = (res << 1) + (res << 3) + (c - '0');
    c = getchar();
  }
  res *= opt;
}
int n, leftRange, rightRange, lower, upper, maxUp;
int u, v, w, centerOfGravity, tag, ans, ansl, ansr;
int leftPointer, rightPointer, queue[100010], idQueue[100010], id[100010];
int done[100010], sum[100010], doneId[100010], Iidqueue[100010];
int shape[100010], maxDist[100010], sonSize[100010], dist[100010];
bool vis[100010];
int sonnum;
struct Son {
  int id, len;
} son[100010];
class Graph {
 public:
  struct {
    int to, len, next;
  } edge[100010 << 1];
  int tot, head[100010];
  void init(int n) {
    for (int i = 0; i <= n; ++i) head[i] = -1;
  }
  void link(int from, int to, int len) {
    edge[tot] = {to, len, head[from]};
    head[from] = tot++;
  }
};
Graph gh;
bool cmpo(Son &a, Son &b) { return maxDist[a.id] < maxDist[b.id]; }
void getRoot(int pos, int father, int size) {
  sonSize[pos] = 1;
  int maxSonSize = 0;
  for (int i = gh.head[pos], next; i != -1; i = gh.edge[i].next) {
    next = gh.edge[i].to;
    if (next == father or vis[next]) continue;
    getRoot(next, pos, size);
    sonSize[pos] += sonSize[next];
    maxSonSize = max(maxSonSize, sonSize[next]);
  }
  maxSonSize = max(maxSonSize, size - sonSize[pos]);
  if (maxSonSize < tag) tag = maxSonSize, centerOfGravity = pos;
}
void getshape(int pos, int father) {
  shape[pos] = 1;
  maxDist[pos] = dist[pos];
  for (int i = gh.head[pos], next; i != -1; i = gh.edge[i].next) {
    next = gh.edge[i].to;
    if (next == father or vis[next]) continue;
    dist[next] = dist[pos] + 1;
    getshape(next, pos);
    shape[pos] += shape[next];
    maxDist[pos] = max(maxDist[pos], maxDist[next]);
  }
}
void getSum(int pos, int father, int mid, int d, int deep) {
  if (d > sum[deep]) {
    sum[deep] = d;
    id[deep] = pos;
  }
  maxUp = max(maxUp, deep);
  for (int i = gh.head[pos], next; i != -1; i = gh.edge[i].next) {
    next = gh.edge[i].to;
    if (next == father or vis[next]) continue;
    int len = (gh.edge[i].len >= mid ? 1 : -1);
    getSum(next, pos, mid, d + len, deep + 1);
  }
}
bool check(int pos, int mid, int u) {
  for (int i = 0; i <= u + 2; ++i) done[i] = -(1e9 + 2), sum[i] = -(1e9 + 2);
  leftPointer = 0, rightPointer = -1;
  int up = 0;
  done[0] = 0;
  doneId[0] = pos;
  sum[0] = 0;
  for (int j = 1; j <= sonnum; ++j) {
    int next = son[j].id;
    maxUp = -1;
    int len = (son[j].len >= mid ? 1 : -1);
    getSum(next, pos, mid, len, 1);
    int now = leftRange - maxUp;
    now = (now < 0 ? 0 : now);
    for (int i = maxUp; i >= 0; --i) {
      while (now <= up and now + i <= rightRange) {
        while (leftPointer <= rightPointer and done[now] >= queue[rightPointer])
          --rightPointer;
        queue[++rightPointer] = done[now];
        idQueue[rightPointer] = now;
        Iidqueue[rightPointer] = doneId[now];
        now++;
      }
      while (leftPointer <= rightPointer and
             idQueue[leftPointer] + i < leftRange)
        ++leftPointer;
      if (leftPointer <= rightPointer and queue[leftPointer] + sum[i] >= 0) {
        if (mid > ans) {
          ans = mid;
          ansl = Iidqueue[leftPointer];
          ansr = id[i];
        }
        return true;
      }
    }
    for (int i = 1; i <= u + 2; ++i) {
      if (sum[i] > done[i]) {
        done[i] = sum[i];
        doneId[i] = id[i];
      }
      sum[i] = -(1e9 + 2);
    }
    up = max(up, maxUp);
  }
  return false;
}
void treeDivide(int pos) {
  vis[pos] = true;
  dist[pos] = 0;
  getshape(pos, -1);
  sonnum = 0;
  for (int i = gh.head[pos], next; i != -1; i = gh.edge[i].next) {
    next = gh.edge[i].to;
    if (vis[next]) continue;
    son[++sonnum].id = next;
    son[sonnum].len = gh.edge[i].len;
  }
  std::sort(son + 1, son + sonnum + 1, cmpo);
  int li = ans - 1, ri = upper + 1;
  while (li < ri - 1) {
    int mid = (li + ri) >> 1;
    if (check(pos, mid, maxDist[son[sonnum].id]))
      li = mid;
    else
      ri = mid;
  }
  for (int i = gh.head[pos], next; i != -1; i = gh.edge[i].next) {
    next = gh.edge[i].to;
    if (vis[next]) continue;
    tag = (1e9 + 2);
    getRoot(next, pos, shape[next]);
    treeDivide(centerOfGravity);
  }
}
int main() {
  read(n);
  gh.init(n);
  ans = -1;
  upper = -1;
  read(leftRange);
  read(rightRange);
  for (int i = 2; i <= n; ++i) {
    read(u);
    read(v);
    read(w);
    gh.link(u, v, w);
    gh.link(v, u, w);
    upper = max(upper, w);
  }
  tag = (1e9 + 2);
  getRoot(1, -1, n);
  treeDivide(centerOfGravity);
  printf("%d %d\n", ansl, ansr);
  return 0;
}