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 = int(1e9);
const long double EPS = 1e-9;
const long double PI = acos(-1.0);
const int N = 100010;
struct pt {
  int first, second;
  pt() {}
  explicit pt(int cX, int cY) : first(cX), second(cY) {}
  bool operator<(const pt& c) const {
    if (first != c.first) return first < c.first;
    return second < c.second;
  }
};
int MID;
int n, lf, rg;
int szg[N];
vector<pt> ig[N];
pt* g[N];
int d[N], p[N], pr[N];
int H, T;
int q[N];
int cnt;
int scnt[N];
int bfs(int st) {
  d[st] = 0;
  pr[st] = st;
  cnt = 1;
  H = T = 0;
  q[T++] = st;
  int ans = st;
  int ansV = 0;
  while (H != T) {
    int v = q[H++];
    for (int i = 0; i < int(szg[v]); ++i) {
      int u = g[v][i].first;
      if (pr[v] != u) {
        cnt++;
        d[u] = d[v] + 1;
        pr[u] = v;
        q[T++] = u;
        if (d[u] > ansV) {
          ansV = d[u];
          ans = u;
        }
      }
    }
  }
  for (int i = int(T) - 1; i >= 0; --i) {
    int v = q[i];
    scnt[v] = 1;
    for (int j = 0; j < int(szg[v]); ++j) {
      int u = g[v][j].first;
      if (pr[v] != u) scnt[v] += scnt[u];
    }
  }
  return st;
}
int findRoot(int st) {
  int v = bfs(st);
  bool change = true;
  while (change) {
    change = false;
    for (int i = 0; i < int(szg[v]); ++i) {
      int u = g[v][i].first;
      if (pr[v] == u) continue;
      if (scnt[u] > (cnt >> 1)) {
        v = u;
        change = true;
        break;
      }
    }
  }
  return v;
}
int maxN;
int trM[4 * N], trI[4 * N];
int mx[N];
void update(int i, int val, int v, int idx = 0, int lf = 0, int rg = maxN) {
  if (lf == rg) {
    trM[idx] = val;
    trI[idx] = v;
    mx[lf] = val;
  } else {
    int mid = lf + ((rg - lf) >> 1);
    if (i <= mid)
      update(i, val, v, (idx << 1) + 1, lf, mid);
    else
      update(i, val, v, (idx << 1) + 2, mid + 1, rg);
    if (trM[(idx << 1) + 1] >= trM[(idx << 1) + 2]) {
      trM[idx] = trM[(idx << 1) + 1];
      trI[idx] = trI[(idx << 1) + 1];
    } else {
      trM[idx] = trM[(idx << 1) + 2];
      trI[idx] = trI[(idx << 1) + 2];
    }
  }
}
pt getMax(int qlf, int qrg, int idx = 0, int lf = 0, int rg = maxN) {
  if (qlf == lf && qrg == rg)
    return pt(trM[idx], trI[idx]);
  else {
    int mid = lf + ((rg - lf) >> 1);
    pt res(-INF, -1);
    if (qlf <= mid)
      res = max(res, getMax(qlf, min(qrg, mid), (idx << 1) + 1, lf, mid));
    if (mid + 1 <= qrg)
      res =
          max(res, getMax(max(mid + 1, qlf), qrg, (idx << 1) + 2, mid + 1, rg));
    return res;
  }
}
pt bfsTry(int st) {
  H = T = 0;
  q[T++] = st;
  int prD = 0;
  pt cache(0, -2);
  while (H != T) {
    int v = q[H++];
    if (prD != d[v]) {
      prD = d[v];
      cache.second = -2;
    }
    int clf = max(0, lf - d[v]);
    int crg = min(maxN, rg - d[v]);
    if (clf <= crg) {
      pt cur;
      if (cache.second == -2)
        cur = cache = getMax(clf, crg);
      else
        cur = cache;
      if (cur.first + p[v] >= 0) return pt(v, cur.second);
    }
    for (int i = 0; i < int(szg[v]); ++i) {
      int u = g[v][i].first;
      if (pr[v] == u) continue;
      d[u] = d[v] + 1;
      p[u] = p[v] + (((g[v][i].second) >= MID) ? (1) : (-1));
      pr[u] = v;
      q[T++] = u;
    }
  }
  for (int i = 0; i < int(T); ++i) {
    int u = q[i];
    if (lf - maxN <= d[u] && d[u] <= rg && mx[d[u]] < p[u])
      update(d[u], p[u], u);
  }
  return pt(-1, -1);
}
pt checkTree(int v) {
  v = findRoot(v);
  maxN = (cnt >> 1);
  if (lf > cnt - 1) return pt(-1, -1);
  memset(trM, (1 << 7), sizeof(int) * 4 * (maxN + 1));
  memset(mx, (1 << 7), sizeof(int) * (maxN + 1));
  update(0, 0, v);
  for (int i = int(szg[v]) - 1; i >= 0; --i) {
    int u = g[v][i].first;
    pr[u] = v;
    p[u] = (((g[v][i].second) >= MID) ? (1) : (-1));
    d[u] = 1;
    pt cur = bfsTry(u);
    if (cur.first != -1) return cur;
  }
  for (int i = 0; i < int(szg[v]); ++i) {
    int u = g[v][i].first;
    for (int j = 0; j < int(szg[u]); ++j)
      if (g[u][j].first == v) {
        swap(g[u][j], g[u][szg[u] - 1]);
        szg[u]--;
        break;
      }
    pt res = checkTree(u);
    if (res.first != -1) return res;
  }
  return pt(-1, -1);
}
pt check(bool print = false) {
  for (int i = 0; i < int(n); ++i) szg[i] = int((ig[i]).size());
  return checkTree(0);
}
int main() {
  cin >> n >> lf >> rg;
  vector<int> xs;
  xs.reserve(n - 1);
  for (int i = 0; i < int(n - 1); ++i) {
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    x--;
    y--;
    ig[x].push_back(pt(y, z));
    ig[y].push_back(pt(x, z));
    xs.push_back(z);
  }
  for (int i = 0; i < int(n); ++i) {
    g[i] = new pt[int((ig[i]).size())];
    for (int j = 0; j < int(int((ig[i]).size())); ++j) g[i][j] = ig[i][j];
  }
  sort((xs).begin(), (xs).end());
  xs.erase(unique((xs).begin(), (xs).end()), xs.end());
  {
    int lf = 0, rg = int((xs).size()) - 1;
    while (rg - lf > 3) {
      int mid = lf + ((rg - lf) >> 1);
      MID = xs[mid];
      if (check().first != -1)
        lf = mid;
      else
        rg = mid;
    }
    for (int mid = rg; mid >= lf; --mid) {
      MID = xs[mid];
      pt cur = check();
      if (cur.first != -1) {
        printf("%d %d\n", cur.first + 1, cur.second + 1);
        cerr << clock() << endl;
        return 0;
      }
    }
  }
  throw;
}