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;
int n, cnt, L, R, ans1, ans2;
int sorted[100010];
bool flag[100010];
struct Edge {
  int v, c;
  Edge() {}
  Edge(int v, int c) : v(v), c(c) {}
  friend bool operator<(const Edge &a, const Edge &b) { return a.c < b.c; }
};
vector<Edge> to[100010];
void Read(int &digit) {
  digit = 0;
  static char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    ;
  for (; c >= '0' && c <= '9'; digit = digit * 10 + c - '0', c = getchar())
    ;
}
void read() {
  Read(n), Read(L), Read(R);
  for (int i = 1, a, b, c; i <= n - 1; i++) {
    Read(a), Read(b), Read(c);
    to[a].push_back(Edge(b, c));
    to[b].push_back(Edge(a, c));
    sorted[i] = c;
  }
  sort(sorted + 1, sorted + n);
  cnt = unique(sorted + 1, sorted + n) - sorted - 1;
}
int FindRoot(int p) {
  static int queue[100010], use[100010], size[100010], father[100010];
  int front = 0, rear = 1;
  use[p] = true, queue[rear] = p, size[p] = 1;
  while (front < rear) {
    int p = queue[++front];
    for (int i = 0; i < to[p].size(); i++)
      if (use[to[p][i].v] == false && flag[to[p][i].v] == false) {
        use[to[p][i].v] = true;
        size[to[p][i].v] = 1;
        father[to[p][i].v] = p;
        queue[++rear] = to[p][i].v;
      }
  }
  for (int i = rear; i > 1; i--) {
    size[father[queue[i]]] += size[queue[i]];
    use[queue[i]] = false;
  }
  use[p] = false;
  for (int i = rear; i > 1; i--) {
    int q = queue[i];
    int maxs = size[p] - size[q];
    for (int j = 0; j < to[q].size(); j++)
      if (father[q] != to[q][j].v && maxs < size[to[q][j].v])
        maxs = size[to[q][j].v];
    if (maxs <= size[p] / 2) return queue[i];
  }
  return p;
}
const int sign[] = {1, -1};
int Mid;
bool mark;
void work(int p) {
  static int max1[100010], max2[100010], pos1[100010], pos2[100010];
  static int queue[100010], l[100010], num[100010], sum[100010], dep[100010];
  static bool use[100010];
  int front = 0, rear = 1, cnt = 0;
  queue[rear] = p, use[p] = true;
  dep[p] = 0, sum[p] = 0, num[p] = 0;
  while (front < rear) {
    int p = queue[++front];
    if (dep[p] == R) continue;
    for (int i = 0; i < to[p].size(); i++)
      if (use[to[p][i].v] == false && flag[to[p][i].v] == false) {
        int q = to[p][i].v;
        use[q] = true;
        queue[++rear] = q;
        num[q] = front == 1 ? ++cnt : num[p];
        sum[q] = sum[p] + sign[to[p][i].c < Mid];
        dep[q] = dep[p] + 1;
      }
  }
  l[0] = 1, use[queue[1]] = false;
  for (int i = 2; i <= rear; i++) {
    if (dep[queue[i]] != dep[queue[i - 1]]) l[dep[queue[i]]] = i;
    use[queue[i]] = false;
  }
  for (int i = 1; i <= rear; i++) {
    max1[i] = sum[queue[i - (i & (-i)) + 1]];
    pos1[i] = queue[i - (i & (-i)) + 1];
    max2[i] = -1 << 30;
    for (int j = i - (i & (-i)) + 2; j <= i; j++) {
      int q = queue[j];
      if (max1[i] < sum[q]) {
        if (num[pos1[i]] != num[q])
          max2[i] = max1[i], pos2[i] = pos1[i], pos1[i] = q;
        max1[i] = sum[q], pos1[i] = q;
      } else if (max2[i] < sum[q] && num[pos1[i]] != num[q])
        max2[i] = sum[q], pos2[i] = q;
    }
  }
  for (int i = 1; i <= rear; i++) {
    int x = L - dep[queue[i]], y = R - dep[queue[i]] + 1;
    if (x > dep[queue[rear]]) continue;
    int a = queue[i], r = l[y] - 1;
    if (y > dep[queue[rear]]) r = rear;
    int lim = max(l[x], i + 1);
    for (int j = r; j >= lim;) {
      if (j - (j & (-j)) + 1 < lim) {
        if (num[a] != num[queue[j]] && sum[a] + sum[queue[j]] >= 0) {
          mark = true, ans1 = a, ans2 = queue[j];
          return;
        }
        j--;
      } else {
        if (num[a] == num[pos1[j]]) {
          if (sum[a] + max2[j] >= 0) {
            mark = true, ans1 = a, ans2 = pos2[j];
            return;
          }
        } else {
          if (sum[a] + max1[j] >= 0) {
            mark = true, ans1 = a, ans2 = pos1[j];
            return;
          }
        }
        j -= (j & (-j));
      }
    }
  }
}
void DFS(int p) {
  int Root = FindRoot(p);
  work(Root), flag[Root] = true;
  if (mark) return;
  for (int i = 0; i < to[Root].size(); i++)
    if (flag[to[Root][i].v] == false) {
      DFS(to[Root][i].v);
      if (mark) return;
    }
}
bool check(int v) {
  memset(flag, false, sizeof(flag));
  Mid = v;
  mark = false;
  DFS(1);
  return mark;
}
void binary(int l, int r) {
  if (check(sorted[r])) {
    printf("%d %d\n", ans1, ans2);
    return;
  }
  while (l < r) {
    int mid = (l + r) >> 1;
    check(sorted[mid]) ? l = mid + 1 : r = mid;
  }
  check(sorted[l - 1]);
  printf("%d %d\n", ans1, ans2);
}
int main() {
  read();
  binary(1, cnt);
  return 0;
}