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;
const int inf = -1e9 - 7;
const int maxn = 100010;
int n, l, r;
vector<pair<int, int> > adj[maxn];
vector<int> cen;
vector<int> nums;
int sub[maxn];
int mark[maxn];
int SZ = 1;
int seg[maxn * 5];
int dp[maxn];
int mh;
int V;
int vdp[maxn];
int lg = 1;
int sz[maxn];
void clr(int L = 0, int R = SZ, int id = 1) {
  if (seg[id] == inf) return;
  seg[id] = inf;
  if (L == R - 1) return;
  int mid = (L + R) >> 1;
  clr(L, mid, id << 1);
  clr(mid, R, (id << 1) | 1);
}
void dfss(int root, int par) {
  sub[root] = 1;
  for (auto x : adj[root])
    if (!mark[x.first] and x.first != par) {
      dfss(x.first, root);
      sub[root] += sub[x.first];
    }
}
queue<int> inds;
inline void cnf(int v, int par) {
  inds.push(v);
  while (inds.size()) {
    v = inds.front();
    inds.pop();
    dfss(v, -1);
    int k = sub[v] >> 1;
    int dad = -1;
    int med = v;
    while (1) {
      bool found = 0;
      for (auto e : adj[med]) {
        int x = e.first;
        if (!mark[x] and sub[x] >= k and x != dad) {
          dad = med;
          med = x;
          found = 1;
          break;
        }
      }
      if (!found) break;
    }
    cen.push_back(med);
    mark[med] = 1;
    sz[med] = sub[v];
    for (auto e : adj[med])
      if (!mark[e.first]) inds.push(e.first);
  }
}
int fnd(int l, int r, int id = 1, int L = 0, int R = SZ) {
  if (R <= l or r <= L) return inf;
  if (l <= L and R <= r) return seg[id];
  int mid = (L + R) >> 1;
  return max(fnd(l, r, id << 1, L, mid), fnd(l, r, (id << 1) | 1, mid, R));
}
void inline add(int id, int x) {
  id += SZ;
  while (id) {
    seg[id] = max(seg[id], x);
    id >>= 1;
  }
}
void dfs(int root, int dad, int t, int h, int mid) {
  bool ret = 0;
  if (h > mh) {
    dp[h] = inf;
    mh = h;
  }
  if (dp[h] < t) {
    vdp[h] = root;
    dp[h] = t;
  }
  for (auto e : adj[root]) {
    if (lg != mark[e.first] and e.first != dad) {
      int T = e.second;
      if (T >= mid)
        T = +1;
      else
        T = -1;
      dfs(e.first, root, t + T, h + 1, mid);
    }
  }
}
inline bool check(int mid) {
  for (auto med : cen) {
    if (sz[med] < l) continue;
    mark[med] = lg;
    clr();
    add(0, 0);
    for (auto e : adj[med]) {
      mh = 0;
      if (mark[e.first] == lg) continue;
      int t = e.second;
      if (t >= mid)
        t = +1;
      else
        t = -1;
      dfs(e.first, med, t, 1, mid);
      for (int j = 1; j < mh + 1; j++) {
        int lf = l - j;
        int rf = r - j + 1;
        int k = fnd(lf, rf);
        if (k + dp[j] >= 0) {
          V = vdp[j];
          return 1;
        }
      }
      for (int j = 1; j < mh + 1; j++)
        if (dp[j] > seg[j + SZ]) add(j, dp[j]);
    }
  }
  return 0;
}
void fff(int root, int par, int st, int h = 0, int t = 0) {
  if (l <= h and h <= r and t >= 0) {
    printf(" %d", root + 1);
    exit(0);
  }
  for (auto e : adj[root]) {
    if (e.first != par) {
      int T = e.second;
      if (T >= st)
        T = +1;
      else
        T = -1;
      fff(e.first, root, st, h + 1, t + T);
    }
  }
}
inline bool cmp(int x, int y) { return sz[x] > sz[y]; }
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 1; i < n; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    a--, b--;
    nums.push_back(c);
    adj[a].push_back(make_pair(b, c));
    adj[b].push_back(make_pair(a, c));
  }
  sort(nums.begin(), nums.end());
  unique(nums.begin(), nums.end());
  cnf(0, -1);
  while (SZ < n) SZ <<= 1;
  int st = 0;
  int en = nums.size();
  while (st != en - 1) {
    lg++;
    int ind = (st + en) / 2;
    if (check(nums[ind]))
      st = ind;
    else
      en = ind;
  }
  printf("%d", V + 1);
  fff(V, -1, nums[st]);
}