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>
using namespace std;
const int Max = 2e5 + 10;
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > ans1, ans2;
vector<int> N[Max];
bool seen[Max];
pair<int, int> lowl[Max];
int blue[Max];
pair<pair<int, int>, pair<int, int> > dp[Max];
void DFS1(int v) {
  seen[v] = true;
  vector<int> C;
  lowl[v] = {0, v};
  for (auto u : N[v])
    if (!seen[u]) {
      DFS1(u);
      C.push_back(u);
      lowl[v] = max(lowl[u] + pair<int, int>{1, 0}, lowl[v]);
      blue[v] += blue[u];
    }
  if (blue[v]) {
    for (auto u : C)
      if (blue[u])
        dp[v] = max(
            pair<pair<int, int>, pair<int, int> >{
                dp[u].first + pair<int, int>{1, 2}, dp[u].second},
            dp[v]);
  } else if (C.size() > 1) {
    blue[v]++;
    pair<int, int> mx1 = {-1, 0};
    pair<int, int> mx2 = {-1, 0};
    for (auto u : C)
      if (lowl[u] > mx1) {
        mx2 = mx1;
        mx1 = lowl[u];
      } else if (lowl[u] > mx2)
        mx2 = lowl[u];
    mx1 = mx1 + pair<int, int>{1, 0};
    mx2 = mx2 + pair<int, int>{1, 0};
    dp[v] = {{0, mx1.first + mx2.first}, {mx1.second, mx2.second}};
  }
  int childblue = 0;
  for (auto u : C)
    if (blue[u]) childblue++;
  if (childblue > 1) {
    pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > ans;
    pair<pair<int, int>, pair<int, int> > mx1;
    pair<pair<int, int>, pair<int, int> > mx2;
    for (auto u : C)
      if (dp[u] > mx1) {
        mx2 = mx1;
        mx1 = dp[u];
      } else if (dp[u] > mx2)
        mx2 = dp[u];
    mx1 = {mx1.first + pair<int, int>{1, 2}, mx1.second};
    mx2 = {mx2.first + pair<int, int>{1, 2}, mx2.second};
    ans = make_pair(pair<int, int>{mx1.first.first + mx2.first.first,
                                   mx1.first.second + mx2.first.second},
                    pair<pair<int, int>, pair<int, int> >{
                        pair<int, int>{mx1.second.first, mx2.second.first},
                        pair<int, int>{mx1.second.second, mx2.second.second}});
    ans1 = max(ans1, ans);
  }
}
pair<int, int> topl[Max];
pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > mrg(
    pair<pair<int, int>, pair<int, int> > a, pair<int, int> b,
    pair<int, int> c) {
  return make_pair(
      pair<int, int>{a.first.first + 1, a.first.second + 2 + b.first + c.first},
      make_pair(pair<int, int>{a.second.first, b.second},
                pair<int, int>{a.second.second, c.second}));
}
int root = 0;
void DFS2(int v) {
  seen[v] = true;
  vector<int> C;
  for (int u : N[v])
    if (!seen[u]) C.push_back(u);
  vector<pair<int, int> > prfmx;
  vector<pair<int, int> > sufmx;
  prfmx.push_back({0, 0});
  pair<int, int> suf = {0, 0};
  pair<int, int> prf = {0, 0};
  for (int i = 0; i < C.size(); i++) {
    prf = max(prf, lowl[C[i]]);
    prfmx.push_back(prf);
  }
  for (int i = C.size(); i--;) {
    suf = max(suf, lowl[C[i]]);
    sufmx.push_back(suf);
  }
  reverse(sufmx.begin(), sufmx.end());
  sufmx.push_back({0, 0});
  for (int i = 0; i < C.size(); i++)
    topl[C[i]] = max(max(prfmx[i], sufmx[i + 1]) + pair<int, int>{2, 0},
                     topl[v] + pair<int, int>{1, 0});
  for (auto u : C) DFS2(u);
  bool childblue = false;
  for (auto u : C) childblue |= blue[u];
  if (childblue && C.size() > 1 && v != root || C.size() >= 3) {
    pair<pair<pair<int, int>, pair<int, int> >, int> mx[3];
    pair<pair<int, int>, int> m[3];
    for (auto u : C) {
      if (blue[u]) {
        pair<pair<pair<int, int>, pair<int, int> >, int> a1 = {dp[u], u};
        if (a1 > mx[0]) {
          mx[2] = mx[1];
          mx[1] = mx[0];
          mx[0] = a1;
        } else if (a1 > mx[1]) {
          mx[2] = mx[1];
          mx[1] = a1;
        } else if (a1 > mx[2])
          mx[2] = a1;
      }
      pair<pair<int, int>, int> a2 = {lowl[u], u};
      if (a2 > m[0]) {
        m[2] = m[1];
        m[1] = m[0];
        m[0] = a2;
      } else if (a2 > m[1]) {
        m[2] = m[1];
        m[1] = a2;
      } else if (a2 > m[2])
        m[2] = a2;
    }
    if (v != root) {
      pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > ans;
      if (mx[0].second != m[0].second)
        ans = mrg(mx[0].first, m[0].first, topl[v]);
      else
        ans = max(mrg(mx[0].first, m[1].first, topl[v]),
                  mrg(mx[1].first, m[0].first, topl[v]));
      ans2 = max(ans2, ans);
    }
    if (C.size() >= 3) {
      pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > ans;
      for (int i = 0; i < 3; i++)
        for (int j = 0; j < 3; j++)
          for (int k = j + 1; k < 3; k++)
            if (mx[i].second != m[j].second && mx[i].second != m[k].second)
              ans = max(ans, mrg(mx[i].first, m[j].first, m[k].first));
      ans2 = max(ans2, ans);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    N[a].push_back(b);
    N[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    if (N[i].size() > 1) {
      root = i;
      break;
    }
  DFS1(root);
  for (int i = 1; i <= n; i++) seen[i] = false;
  topl[root] = {-6 * n, -2};
  DFS2(root);
  pair<pair<int, int>, pair<pair<int, int>, pair<int, int> > > ans =
      max(ans1, ans2);
  cout << '\n';
  cout << ans.second.first.first << " " << ans.second.first.second << '\n';
  cout << ans.second.second.first << " " << ans.second.second.second << '\n';
}