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 sz[200007];
int removed[200007];
int rm;
vector<int> adj[200007];
vector<int> cst[200007];
int tot;
void dfs_sz(int u, int papa) {
  sz[u] = 1;
  tot++;
  for (auto v : adj[u]) {
    if (v == papa || removed[v] == rm) continue;
    dfs_sz(v, u);
    sz[u] += sz[v];
  }
}
int find_center(int u, int papa) {
  for (auto v : adj[u]) {
    if (v == papa || removed[v] == rm) continue;
    if (sz[v] > (tot / 2)) return find_center(v, u);
  }
  return u;
}
int n, l, r;
int need, suru, ses;
int val[200007];
int nam[200007];
int tree[2 * 200007];
void update(int idx, int val) {
  idx--;
  for (tree[idx += n] = val; idx > 1; idx >>= 1) {
    tree[idx >> 1] = (tree[idx] < tree[idx ^ 1] ? tree[idx ^ 1] : tree[idx]);
  }
}
int query(int x, int y) {
  int ret = -1000000000;
  x--;
  for (x += n, y += n; x < y; x >>= 1, y >>= 1) {
    if (x & 1) ret = (ret < tree[x] ? tree[x] : ret), x++;
    if (y & 1) --y, ret = (ret < tree[y] ? tree[y] : ret);
  }
  return ret;
}
int mxlev;
int root;
int ret;
void go(int u, int papa, int lev, int c) {
  if (lev > r) return;
  if (lev > mxlev) {
    mxlev = lev;
    val[lev] = c;
    nam[lev] = u;
    update(lev, c);
  } else if (val[lev] < c) {
    val[lev] = c;
    nam[lev] = u;
    update(lev, c);
  }
  for (int i = 0; i < (int)adj[u].size(); i++) {
    int v = adj[u][i];
    int cc = cst[u][i];
    if (v == papa || removed[v] == rm) continue;
    go(v, u, lev + 1, c + (cc >= need ? 1 : -1));
  }
}
inline void find(int u, int papa, int lev, int c) {
  if (lev > r) return;
  if (lev >= l && lev <= r && c >= 0) {
    ret = 1;
    ses = u;
    return;
  }
  if (lev < l) {
    int x = l - lev;
    int y = min(r - lev, mxlev);
    if (x <= y) {
      int mx = query(x, y);
      if (mx + c >= 0) {
        ret = 1;
        ses = u;
        return;
      }
    }
  } else {
    int x = 1;
    int y = r - lev;
    y = (y < mxlev ? y : mxlev);
    if (x <= y) {
      int mx = query(x, y);
      if (mx + c >= 0) {
        ret = 1;
        ses = u;
        return;
      }
    }
  }
  for (int i = 0; i < (int)adj[u].size(); i++) {
    int v = adj[u][i];
    int cc = cst[u][i];
    if (v == papa || removed[v] == rm) continue;
    find(v, u, lev + 1, c + (cc >= need ? 1 : -1));
    if (ret) return;
  }
}
inline void calculate(int u) {
  root = u;
  mxlev = 0;
  for (int i = 0; i < (int)adj[u].size(); i++) {
    int v = adj[u][i];
    if (removed[v] == rm) continue;
    find(v, u, 1, (cst[u][i] >= need) ? 1 : -1);
    if (ret) return;
    go(v, u, 1, (cst[u][i] >= need) ? 1 : -1);
    if (ret) return;
  }
}
void dfs(int center) {
  tot = 0;
  dfs_sz(center, -1);
  center = find_center(center, -1);
  removed[center] = rm;
  calculate(center);
  if (ret) return;
  for (auto v : adj[center]) {
    if (removed[v] == rm) continue;
    dfs(v);
    if (ret) return;
  }
}
int median;
void show(int u, int papa, int lev, int c) {
  if (papa != -1 && lev >= l && lev <= r && c >= 0) {
    printf("%d %d\n", ses, u);
    exit(0);
  }
  for (int i = 0; i < (int)adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == papa) continue;
    int cc = cst[u][i];
    if (cc >= median)
      cc = 1;
    else
      cc = -1;
    show(v, u, lev + 1, c + cc);
  }
}
int main() {
  scanf("%d%d%d", &(n), &(l), &(r));
  for (int i = 0; i <= 2 * n; i++) {
    tree[i] = -1000000000;
    val[i] = -1000000000;
  }
  int mx = 0;
  for (int i = 1; i <= n - 1; i++) {
    int x, y, c;
    scanf("%d%d%d", &(x), &(y), &(c));
    ;
    adj[x].push_back(y);
    adj[y].push_back(x);
    cst[x].push_back(c);
    cst[y].push_back(c);
    mx = (c < mx ? mx : c);
  }
  int low = 0;
  int high = mx;
  while (low <= high) {
    int mid = (low + high) >> 1;
    need = mid;
    ret = 0;
    rm++;
    dfs(1);
    if (ret) {
      median = mid;
      low = mid + 1;
    } else {
      high = mid - 1;
    }
  }
  show(ses, -1, 0, 0);
  return 0;
}