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 Set(int n, int pos) { return n = n | (1LL << pos); }
int reset(int n, int pos) { return n = n & ~(1LL << pos); }
bool check(int n, int pos) { return (bool)(n & (1LL << pos)); }
int mul(int a, int b) {
  int c;
  c = (a % 1000000007 * b % 1000000007) % 1000000007;
  return c;
}
int add(int a, int b) {
  int c;
  c = (a % 1000000007 + b % 1000000007) % 1000000007;
  return c;
}
int sub(int a, int b) {
  int c;
  c = ((a % 1000000007 - b % 1000000007) % 1000000007 + 1000000007) %
      1000000007;
  return c;
}
int power(int x, int y, int p) {
  int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int s2, s1, t2, t1;
int egcd(int a, int b) {
  int temp;
  if (a % b == 0) {
    return s1;
  }
  temp = s2 - (a / b) * s1;
  s2 = s1;
  s1 = temp;
  temp = t2 - (a / b) * t1;
  t2 = t1;
  t1 = temp;
  return egcd(b, a % b);
}
int n, llimit, rlimit, maxL, ans, xx, yy, tot, mid, global_max_length_covered,
    local_max_length_covered, U, V;
vector<pair<int, int> > graph[100005];
bool vis[100005];
int siz[100005], mxson[100005], to[100005], w[100005];
int seg[3 * 100005];
int node[3 * 100005];
int now_dis_with_best_sum[100005];
int now_node_with_best_sum[100005];
bool cmp(int a, int b) { return siz[a] < siz[b]; }
void build() {
  for (int i = n - 1; i > 0; --i) {
    if (seg[i << 1] >= seg[i << 1 | 1]) {
      seg[i] = seg[i << 1];
      node[i] = node[i << 1];
    } else {
      seg[i] = seg[i << 1 | 1];
      node[i] = node[i << 1 | 1];
    }
  }
}
void modify(int p, int value, int nodee, int type) {
  p += n;
  if (type == 1) {
    if (seg[p] >= value) {
      return;
    } else {
      seg[p] = value;
      node[p] = nodee;
      for (; p > 1; p >>= 1) {
        if (seg[p] >= seg[p ^ 1]) {
          seg[p >> 1] = seg[p];
          node[p >> 1] = node[p];
        } else {
          seg[p >> 1] = seg[p ^ 1];
          node[p >> 1] = node[p ^ 1];
        }
      }
    }
  } else {
    seg[p] = value;
    node[p] = nodee;
    for (; p > 1; p >>= 1) {
      if (seg[p] >= seg[p ^ 1]) {
        seg[p >> 1] = seg[p];
        node[p >> 1] = node[p];
      } else {
        seg[p >> 1] = seg[p ^ 1];
        node[p >> 1] = node[p ^ 1];
      }
    }
  }
}
pair<int, int> query(int l, int r) {
  r++;
  int res = -900000000;
  int res_node = -900000000;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) {
      if (seg[l] > res) {
        res = seg[l];
        res_node = node[l];
      }
      l++;
    }
    if (r & 1) {
      r--;
      if (seg[r] > res) {
        res = seg[r];
        res_node = node[r];
      }
    }
  }
  return make_pair(res, res_node);
}
int getroot(int src, int par, int sizee) {
  int ret = -1;
  siz[src] = 1;
  mxson[src] = 0;
  for (int i = 0; i < graph[src].size(); i++) {
    int adj = graph[src][i].first;
    if (adj == par || vis[adj]) {
      continue;
    }
    int x = getroot(adj, src, sizee);
    siz[src] += siz[adj];
    mxson[src] = max(mxson[src], siz[adj]);
    if (ret == -1 || mxson[x] < mxson[ret]) ret = x;
  }
  mxson[src] = max(mxson[src], sizee - siz[src]);
  if (ret == -1 || mxson[src] < mxson[ret]) ret = src;
  return ret;
}
void dfs(int src, int par, int dep, int sum) {
  if (dep > rlimit) {
    return;
  }
  if (dep > global_max_length_covered) {
    global_max_length_covered = dep;
  }
  if (dep > local_max_length_covered) {
    local_max_length_covered = dep;
  }
  if (sum > now_dis_with_best_sum[dep]) {
    now_dis_with_best_sum[dep] = sum;
    now_node_with_best_sum[dep] = src;
  }
  for (int i = 0; i < graph[src].size(); i++) {
    int adj = graph[src][i].first;
    int adj_cost = graph[src][i].second;
    if (adj == par || vis[adj]) continue;
    if (adj_cost >= mid)
      dfs(adj, src, dep + 1, sum + 1);
    else
      dfs(adj, src, dep + 1, sum - 1);
  }
}
bool check(int src) {
  bool f = 0;
  for (int i = 0; i < global_max_length_covered + 1; i++) {
    modify(i, -900000000, -2, 2);
  }
  global_max_length_covered = 0;
  modify(0, 0, src, 1);
  for (int i = 0; i < tot; i++) {
    local_max_length_covered = 0;
    int adj = to[i];
    int adj_cost = w[to[i]];
    for (int j = 1; j <= siz[adj]; j++) {
      now_dis_with_best_sum[j] = -900000000;
    }
    if (adj_cost >= mid) {
      dfs(adj, src, 1, 1);
    } else {
      dfs(adj, src, 1, -1);
    }
    for (int j = 1; j <= local_max_length_covered; j++) {
      int lower_limit_now = max(0, llimit - j);
      int higher_limit_now = rlimit - j;
      pair<int, int> ans1 = query(lower_limit_now, higher_limit_now);
      if (ans1.first + now_dis_with_best_sum[j] >= 0) {
        xx = ans1.second;
        yy = now_node_with_best_sum[j];
        ans = mid;
        return 1;
      }
    }
    for (int j = 1; j <= local_max_length_covered; j++) {
      modify(j, now_dis_with_best_sum[j], now_node_with_best_sum[j], 1);
    }
  }
  return 0;
}
void work(int src, int sizee) {
  tot = 0;
  for (int i = 0; i < graph[src].size(); i++) {
    int adj = graph[src][i].first;
    int adj_cost = graph[src][i].second;
    if (vis[adj] == 0) {
      if (siz[adj] > siz[src]) {
        siz[adj] = sizee - siz[src];
      }
      to[tot++] = adj;
      w[adj] = adj_cost;
    }
  }
  if (!tot) return;
  sort(to, to + tot, cmp);
  int l = ans + 1, r = maxL;
  mid = l;
  if (!check(src)) return;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(src)) {
      l = mid + 1;
    } else
      r = mid - 1;
  }
}
void solve(int src, int sizee) {
  int root = getroot(src, 0, sizee);
  vis[root] = 1;
  work(root, sizee);
  for (int i = 0; i < graph[root].size(); i++) {
    int adj = graph[root][i].first;
    if (vis[adj] == 0) {
      solve(adj, siz[adj]);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    seg[n + i] = -900000000;
    node[n + i] = -2;
  }
  build();
  scanf("%d", &llimit);
  scanf("%d", &rlimit);
  for (int i = 1; i <= n - 1; i++) {
    int u, v, c;
    scanf("%d", &u);
    scanf("%d", &v);
    scanf("%d", &c);
    graph[u].push_back(make_pair(v, c));
    graph[v].push_back(make_pair(u, c));
    maxL = max(maxL, c);
  }
  ans = -1;
  solve(1, n);
  printf("%d %d\n", xx, yy);
  return 0;
}