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;
inline void read(int& n) {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  n = x * f;
}
int outputarray[20];
inline void write(int k) {
  int num = 0;
  if (k < 0) putchar('-'), k = -k;
  do {
    outputarray[++num] = k % 10, k /= 10;
  } while (k);
  while (num) putchar(outputarray[num--] + '0');
  puts("");
}
const int N = 1e5 + 5;
struct E {
  int to, v, have, next;
} edge[N << 1];
int n, l, r, head[N], tot = -1, mxdep[N], Ans = -1;
pair<int, int> f[N], g[N], answer;
inline bool cmp(int a, int b) { return mxdep[edge[a].to] < mxdep[edge[b].to]; }
int getsize(int u, int f) {
  int tmp = 1;
  for (int i = head[u]; i != -1; i = edge[i].next)
    if (edge[i].have && edge[i].to != f) tmp += getsize(edge[i].to, u);
  return tmp;
}
int getcenter(int u, int f, int& x, int siz) {
  int s = 1, flag = 1;
  for (int i = head[u]; i != -1; i = edge[i].next)
    if (edge[i].have && edge[i].to != f) {
      int tmp = getcenter(edge[i].to, u, x, siz);
      if ((tmp << 1) > siz) flag = 0;
      s += tmp;
    }
  if (((siz - s) << 1) > siz) flag = 0;
  if (flag) x = u;
  return s;
}
void getdep(int u, int f) {
  mxdep[u] = 1;
  for (int i = head[u]; i != -1; i = edge[i].next)
    if (edge[i].have && edge[i].to != f)
      getdep(edge[i].to, u), mxdep[u] = max(mxdep[u], mxdep[edge[i].to] + 1);
}
void dfs(int u, int f, int d, int dep, int mid) {
  g[dep] = max(g[dep], make_pair(d, u));
  for (int i = head[u]; i != -1; i = edge[i].next)
    if (edge[i].have && edge[i].to != f)
      dfs(edge[i].to, u, d + (edge[i].v >= mid ? 1 : -1), dep + 1, mid);
}
struct QUEUE {
  int id[N], H, T;
  pair<int, int> x[N];
  inline void init() {
    H = 1;
    T = 0;
  }
  inline void push(pair<int, int> p, int q) {
    while (H <= T && x[T] < p) T--;
    T++;
    x[T] = p;
    id[T] = q;
  }
  inline pair<int, int> top() {
    if (H <= T) return x[H];
    return make_pair(-1e9, 0);
  }
  inline void pop(int p) {
    if (H <= T && id[H] == p) H++;
  }
} Q;
void divide(int u) {
  int x;
  getcenter(u, 0, x, getsize(u, 0));
  vector<int> son;
  son.clear();
  for (int i = head[x]; i != -1; i = edge[i].next)
    if (edge[i].have)
      edge[i].have = edge[i ^ 1].have = 0, getdep(edge[i].to, x),
      son.push_back(i);
  sort(son.begin(), son.end(), cmp);
  int depth = 0;
  for (int i = 0; i < son.size(); i++)
    depth = max(depth, mxdep[edge[son[i]].to]);
  int L = 0, R = 1e9;
  pair<int, int> ans = make_pair(-1, -1);
  while (L <= R) {
    int mid = (L + R + 1) >> 1;
    int flag = 0, ret = 0;
    if (L == R) ret = 1;
    for (int i = 1; i <= depth; i++) f[i] = make_pair(-1e9, 0);
    for (int i = 0; i < son.size(); i++) {
      for (int j = 1; j <= mxdep[edge[son[i]].to]; j++)
        g[j] = make_pair(-1e9, 0);
      dfs(edge[son[i]].to, x, edge[son[i]].v >= mid ? 1 : -1, 1, mid);
      int lim = min(r, mxdep[edge[son[i]].to]);
      for (int j = l; j <= lim; j++)
        if (g[j].first >= 0) {
          ans = make_pair(x, g[j].second);
          flag = true;
          break;
        }
      if (flag) break;
      Q.init();
      for (int j = lim; j >= l; j--) Q.push(f[j], j);
      for (int j = 1; j <= mxdep[edge[son[i]].to]; j++) {
        if (j > l) break;
        Q.pop(r + 1 - j);
        if (l - j <= depth) Q.push(f[l - j], l - j);
        pair<int, int> tmp = Q.top();
        if (tmp.first + g[j].first >= 0) {
          ans = make_pair(tmp.second, g[j].second);
          flag = true;
          break;
        }
      }
      if (flag) break;
      for (int j = 1; j <= mxdep[edge[son[i]].to]; j++) f[j] = max(f[j], g[j]);
    }
    if (flag)
      L = mid;
    else
      R = mid - 1;
    if (ret) break;
  }
  if (ans.first > 0 && L > Ans) Ans = L, answer = ans;
  for (int i = 0; i < son.size(); i++) divide(edge[son[i]].to);
}
int main() {
  memset(head, -1, sizeof(head));
  read(n), read(l), read(r);
  for (int i = 1; i < n; i++) {
    int x, y, z;
    read(x), read(y), read(z);
    edge[++tot] = (E){y, z, 1, head[x]};
    head[x] = tot;
    edge[++tot] = (E){x, z, 1, head[y]};
    head[y] = tot;
  }
  divide(1);
  printf("%d %d\n", answer.first, answer.second);
  return 0;
}