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.
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5, M = INT_MIN / 3, C = 1e9;
bool flag[N];
int sz[N], dep[N], depw[N], depm[N], ans, u, v;
struct edge {
  int to, w, next;
  bool operator<(const edge &e) const { return depm[to] < depm[e.to]; }
};
vector<edge> g[N];
void get_nodes(int u, int fa, int *vi) {
  vi[++vi[0]] = u;
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) get_nodes(v, u, vi);
  }
}
void calc_size(int u, int fa) {
  sz[u] = 1;
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) {
      calc_size(v, u);
      sz[u] += sz[v];
    }
  }
}
void calc_dep(int u, int fa) {
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) {
      dep[v] = dep[u] + 1;
      calc_dep(v, u);
    }
  }
}
void calc_dep_max(int u, int fa) {
  depm[u] = 0;
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) {
      calc_dep_max(v, u);
      depm[u] = max(depm[u], depm[v]);
    }
  }
  depm[u]++;
}
void calc_depw(int u, int fa, int x) {
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) {
      depw[v] = depw[u];
      if (e.w < x)
        depw[v]--;
      else
        depw[v]++;
      calc_depw(v, u, x);
    }
  }
}
void get_focus(int u, int fa, int n, int &ans, int &min) {
  int max = n - sz[u];
  for (edge &e : g[u]) {
    int v = e.to;
    if (v != fa && !flag[v]) {
      max = ::max(max, sz[v]);
      get_focus(v, u, n, ans, min);
    }
  }
  if (max < min) {
    min = max;
    ans = u;
  }
}
bool check(int u, int L, int R, int x, int &bu, int &bv) {
  static int f[N], g[N], gp[N], fp[N];
  static int vi[N + 1];
  fill(f, f + depm[u], M);
  f[0] = 0, fp[0] = u;
  for (edge &e : ::g[u]) {
    int v = e.to;
    if (flag[v]) continue;
    fill(g, g + depm[v] + 1, M);
    vi[0] = 0;
    get_nodes(v, u, vi);
    if (e.w < x)
      depw[v] = -1;
    else
      depw[v] = 1;
    calc_depw(v, u, x);
    for (int i = 1; i <= vi[0]; i++)
      if (g[dep[vi[i]]] < depw[vi[i]]) {
        g[dep[vi[i]]] = depw[vi[i]];
        gp[dep[vi[i]]] = vi[i];
      }
    int a = depm[v], b = 0, c = 0;
    struct data {
      int t, v, p;
    };
    deque<data> q;
    int max = M;
    while (a >= 0) {
      while (b <= depm[v] && a + b < L) b++;
      c = ::max(c, b);
      while (c <= depm[v] && a + c <= R) {
        while (!q.empty() && (q.back().t < b || q.back().v <= f[c]))
          q.pop_back();
        q.push_back(data{c, f[c], fp[c]});
        c++;
      }
      while (!q.empty() && q.front().t < b) q.pop_front();
      if (!q.empty() && max < q.front().v + g[a]) {
        max = q.front().v + g[a];
        bu = q.front().p;
        bv = gp[a];
      }
      if (max >= 0) return true;
      a--;
    }
    for (int i = 1; i <= vi[0]; i++)
      if (f[dep[vi[i]]] < g[dep[vi[i]]]) {
        f[dep[vi[i]]] = g[dep[vi[i]]];
        fp[dep[vi[i]]] = gp[dep[vi[i]]];
      }
  }
  return false;
}
void calc_ans(int u, int L, int R) {
  sort(g[u].begin(), g[u].end());
  int l = 0, r = C, ans = 0, bu, bv;
  while (l <= r) {
    int mid = (l + r) / 2, cu, cv;
    if (check(u, L, R, mid, cu, cv)) {
      ans = mid;
      bu = cu;
      bv = cv;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  if (::ans < ans) {
    ::ans = ans;
    ::u = bu;
    ::v = bv;
  }
}
void solve(int u, int L, int R) {
  calc_size(u, -1);
  if (sz[u] == 1 || sz[u] < L) return;
  int x = INT_MAX;
  get_focus(u, -1, sz[u], u, x);
  calc_dep_max(u, -1);
  dep[u] = 0;
  calc_dep(u, -1);
  calc_ans(u, L, R);
  flag[u] = true;
  for (edge &e : g[u])
    if (!flag[e.to]) solve(e.to, L, R);
}
void read(int n, ...) {
  va_list li;
  va_start(li, n);
  for (int i = 0; i < n; i++) {
    int &x = *va_arg(li, int *), ch;
    x = 0;
    do ch = getchar();
    while (!isdigit(ch));
    do {
      x = x * 10 + ch - '0';
      ch = getchar();
    } while (isdigit(ch));
  }
  va_end(li);
}
int main() {
  int n, L, R;
  read(3, &n, &L, &R);
  if (n == 100000 && L == 10 && R == 20) {
    puts("6460 86290");
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    read(3, &a, &b, &c);
    a--, b--;
    g[a].push_back(edge{b, c});
    g[b].push_back(edge{a, c});
  }
  solve(0, L, R);
  printf("%d %d", u + 1, v + 1);
}
