Problem: You are given an undirected unweighted tree consisting of n vertices.

An undirected tree is a connected undirected graph with n - 1 edges.

Your task is to choose two pairs of vertices of this tree (all the chosen vertices should be distinct) (x_1, y_1) and (x_2, y_2) in such a way that neither x_1 nor y_1 belong to the simple path from x_2 to y_2 and vice versa (neither x_2 nor y_2 should not belong to the simple path from x_1 to y_1).

It is guaranteed that it is possible to choose such pairs for the given tree.

Among all possible ways to choose such pairs you have to choose one with the maximum number of common vertices between paths from x_1 to y_1 and from x_2 to y_2. And among all such pairs you have to choose one with the maximum total length of these two paths.

It is guaranteed that the answer with at least two common vertices exists for the given tree.

The length of the path is the number of edges in it.

The simple path is the path that visits each vertex at most once.

Input

The first line contains an integer n — the number of vertices in the tree (6 ≤ n ≤ 2 ⋅ 10^5).

Each of the next n - 1 lines describes the edges of the tree.

Edge i is denoted by two integers u_i and v_i, the labels of vertices it connects (1 ≤ u_i, v_i ≤ n, u_i ≠ v_i).

It is guaranteed that the given edges form a tree.

It is guaranteed that the answer with at least two common vertices exists for the given tree.

Output

Print any two pairs of vertices satisfying the conditions described in the problem statement.

It is guaranteed that it is possible to choose such pairs for the given tree.

Examples

Input

7
1 4
1 5
1 6
2 3
2 4
4 7


Output

3 6
7 5


Input

9
9 3
3 5
1 2
4 3
4 7
1 7
4 6
3 8


Output

2 9
6 8


Input

10
6 8
10 3
3 7
5 8
1 7
7 2
2 9
2 8
1 4


Output

10 6
4 5


Input

11
1 2
2 3
3 4
1 5
1 6
6 7
5 8
5 9
4 10
4 11


Output

9 11
8 10

Note

The picture corresponding to the first example: <image>

The intersection of two paths is 2 (vertices 1 and 4) and the total length is 4 + 3 = 7.

The picture corresponding to the second example: <image>

The intersection of two paths is 2 (vertices 3 and 4) and the total length is 5 + 3 = 8.

The picture corresponding to the third example: <image>

The intersection of two paths is 3 (vertices 2, 7 and 8) and the total length is 5 + 5 = 10.

The picture corresponding to the fourth example: <image>

The intersection of two paths is 5 (vertices 1, 2, 3, 4 and 5) and the total length is 6 + 6 = 12.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
template <typename T>
void MACRO_VAR_Scan(T& t) {
  std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First& first, Rest&... rest) {
  std::cin >> first;
  MACRO_VAR_Scan(rest...);
}
template <typename T>
void MACRO_VEC_ROW_Init(int n, T& t) {
  t.resize(n);
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Init(int n, First& first, Rest&... rest) {
  first.resize(n);
  MACRO_VEC_ROW_Init(n, rest...);
}
template <typename T>
void MACRO_VEC_ROW_Scan(int p, T& t) {
  std::cin >> t[p];
}
template <typename First, typename... Rest>
void MACRO_VEC_ROW_Scan(int p, First& first, Rest&... rest) {
  std::cin >> first[p];
  MACRO_VEC_ROW_Scan(p, rest...);
}
template <class T>
inline T CHMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class T>
inline T CHMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
template <class T>
std::vector<std::vector<T>> VV(int n, int m, T init = T()) {
  return std::vector<std::vector<T>>(n, std::vector<T>(m, init));
}
template <typename S, typename T>
std::ostream& operator<<(std::ostream& os, std::pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = std::pair<ll, ll>;
using PAIRLL = std::pair<ll, ll>;
constexpr ll INFINT = 1 << 30;
constexpr ll INFINT_LIM = (1LL << 31) - 1;
constexpr ll INFLL = 1LL << 60;
constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62);
constexpr double EPS = 1e-10;
constexpr ll MOD = 998244353;
constexpr double PI = 3.141592653589793238462643383279;
template <class T, size_t N>
void FILL(T (&a)[N], const T& val) {
  for (auto& x : a) x = val;
}
template <class ARY, size_t N, size_t M, class T>
void FILL(ARY (&a)[N][M], const T& val) {
  for (auto& b : a) FILL(b, val);
}
template <class T>
void FILL(std::vector<T>& a, const T& val) {
  for (auto& x : a) x = val;
}
template <class ARY, class T>
void FILL(std::vector<std::vector<ARY>>& a, const T& val) {
  for (auto& b : a) FILL(b, val);
}
std::vector<bool> banned;
std::vector<ll> pairSum;
std::vector<ll> getDiameterPath(const std::vector<std::vector<ll>>& g) {
  size_t n = g.size();
  std::vector<ll> depth(n), depth2(n);
  ll maxDepth = 0, farthest = -1;
  std::function<void(std::vector<ll>&, ll, ll)> getDepth =
      [&](std::vector<ll>& d, ll v, ll par) {
        if (par == -1) {
          for (size_t i = 0; i < n; ++i) d[i] = n;
          d[v] = 0;
          maxDepth = 0, farthest = v;
        }
        for (auto&& to : g[v])
          if (to != par && !banned[to]) {
            d[to] = d[v] + 1;
            if (PAIR(maxDepth, pairSum[farthest]) < PAIR(d[to], pairSum[to])) {
              maxDepth = d[farthest = to];
            }
            getDepth(d, to, v);
          }
      };
  ll start = -1;
  for (ll i = 0; i < ll(n); ++i)
    if (!banned[i]) start = i;
  getDepth(depth, start, -1);
  getDepth(depth, farthest, -1);
  getDepth(depth2, farthest, -1);
  const ll R = (maxDepth + 1) / 2;
  for (ll i = 0; i < ll(n); ++i) {
    if (banned[i]) continue;
    if (depth[i] <= R && depth2[i] <= R) {
      getDepth(depth, i, -1);
      getDepth(depth, farthest, -1);
      break;
    }
  }
  std::vector<ll> res(maxDepth + 1);
  size_t now = farthest;
  while (depth[now] != 0) {
    res[depth[now]] = now;
    for (auto&& to : g[now])
      if (depth[to] + 1 == depth[now]) {
        now = to;
        break;
      }
  }
  res[depth[now]] = now;
  return res;
}
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  ;
  ll n;
  MACRO_VAR_Scan(n);
  ;
  std::vector<ll> a, b;
  MACRO_VEC_ROW_Init(n - 1, a, b);
  for (ll w = 0; w < n - 1; ++w) {
    MACRO_VEC_ROW_Scan(w, a, b);
  };
  std::vector<std::vector<ll>> g(n);
  for (ll i = 0; i < ll(n - 1); ++i) {
    --a[i];
    --b[i];
    g[a[i]].emplace_back(b[i]);
    g[b[i]].emplace_back(a[i]);
  }
  std::vector<bool> checked(n, false);
  for (ll i = 0; i < ll(n); ++i) {
    if (g[i].size() >= 3) checked[i] = true;
  }
  banned = checked;
  {
    std::vector<bool> deleted(n, false);
    std::vector<ll> in(n, 0);
    std::queue<ll> que;
    for (ll i = 0; i < ll(n); ++i) {
      in[i] = g[i].size();
      if (g[i].size() == 1) que.push(i), deleted[i] = true;
    }
    while (!que.empty()) {
      ll now = que.front();
      que.pop();
      for (auto& to : g[now])
        if (!banned[to] && !deleted[to]) {
          deleted[to] = true;
          if (--in[to] <= 1) que.push(to);
        }
    }
    for (ll i = 0; i < ll(n); ++i) banned[i] = !deleted[i];
  }
  std::vector<ll> depth(n, INFINT);
  auto getP = [&](ll start) {
    std::vector<PAIR> v;
    for (auto& to : g[start])
      if (!banned[to]) {
        ll dist = 1;
        ll pre = start;
        ll now = to;
        while (true) {
          bool ch = false;
          for (auto& ne : g[now])
            if (ne != pre) {
              ++dist;
              ch = true;
              pre = now;
              now = ne;
              break;
            }
          if (!ch) break;
        }
        v.emplace_back(dist, now);
      }
    std::sort((v).begin(), (v).end());
    std::reverse((v).begin(), (v).end());
    return std::vector<PAIR>({v[0], v[1]});
  };
  pairSum.resize(n, 0);
  for (ll i = 0; i < ll(n); ++i) {
    if (!banned[i]) continue;
    ll cnt = 0;
    for (auto& to : g[i])
      if (banned[to]) ++cnt;
    if (cnt == 1) {
      auto pp = getP(i);
      pairSum[i] = pp[0].first + pp[1].first;
    }
  }
  for (ll i = 0; i < ll(n); ++i) banned[i] = !banned[i];
  auto path = getDiameterPath(g);
  for (ll i = 0; i < ll(n); ++i) banned[i] = !banned[i];
  auto pa(getP(path.front()));
  auto pb(getP(path.back()));
  std::cout << (pa[0].second + 1);
  std::cout << " ";
  std::cout << (pb[0].second + 1);
  std::cout << "\n";
  ;
  std::cout << (pa[1].second + 1);
  std::cout << " ";
  std::cout << (pb[1].second + 1);
  std::cout << "\n";
  ;
  return 0;
}