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 long long N = 2e5 + 4, oo = 1e9 + 7;
long long n;
vector<long long> adj[N];
bool Disable[N];
long long numChild[N], total;
void DFS_CountChild(long long par, long long u) {
  numChild[u] = 1;
  for (long long v : adj[u])
    if (v != par && !Disable[v]) {
      DFS_CountChild(u, v);
      numChild[u] += numChild[v];
    }
}
long long Find_centroid(long long par, long long u) {
  for (long long v : adj[u])
    if (v != par && !Disable[v])
      if (numChild[v] > total / 2) return Find_centroid(u, v);
  return u;
}
pair<long long, long long> dp[N], Trace[N];
long long hei[N], Home[N];
void DFS_Reset(long long par, long long u) {
  dp[u] = pair<long long, long long>(-oo, -oo);
  Trace[u] = pair<long long, long long>(-oo, -oo);
  hei[u] = Home[u] = 0;
  for (long long v : adj[u])
    if (v != par && !Disable[v]) DFS_Reset(u, v);
}
void DFS_getDp(long long par, long long u) {
  long long counter = 0, L = -oo, R = -oo;
  pair<long long, long long> best = pair<long long, long long>(-oo, -oo);
  Home[u] = u;
  for (long long v : adj[u])
    if (v != par && !Disable[v]) {
      DFS_getDp(u, v);
      ++counter;
      if (hei[u] < hei[v] + 1) {
        hei[u] = hei[v] + 1;
        Home[u] = Home[v];
      }
      if (best.first < hei[v]) {
        best.second = best.first;
        best.first = hei[v];
        L = R;
        R = Home[v];
      } else if (best.second < hei[v]) {
        best.second = hei[v];
        L = Home[v];
      }
    }
  if (counter >= 2) {
    dp[u] = pair<long long, long long>(1, best.first + best.second + 2);
    Trace[u] = pair<long long, long long>(L, R);
  }
  for (long long v : adj[u])
    if (v != par && !Disable[v]) {
      if (dp[u].first < dp[v].first + 1) {
        dp[u].first = dp[v].first + 1;
        dp[u].second = dp[v].second + 2;
        Trace[u] = Trace[v];
      } else if (dp[u].first == dp[v].first + 1 &&
                 dp[u].second < dp[v].second + 2) {
        dp[u].second = dp[v].second + 2;
        Trace[u] = Trace[v];
      }
    }
}
pair<long long, long long> res = pair<long long, long long>(-oo, -oo), Pos1,
                           Pos2;
void process(long long par, long long u) {
  DFS_Reset(par, u);
  DFS_getDp(par, u);
  pair<long long, long long> best0 = pair<long long, long long>(-oo, -oo),
                             best1 = pair<long long, long long>(-oo, -oo);
  long long L = -oo, R = -oo;
  for (long long v : adj[u])
    if (v != par && !Disable[v]) {
      if (best0 < dp[v]) {
        best1 = best0;
        best0 = pair<long long, long long>(dp[v].first, dp[v].second);
        L = R;
        R = v;
      } else if (best1 < dp[v])
        best1 = dp[v], L = v;
    }
  pair<long long, long long> val = pair<long long, long long>(
      best0.first + best1.first + 1, best0.second + best1.second + 4);
  if (res < val && val.first >= 0) {
    res = val;
    Pos1 = Trace[L];
    Pos2 = Trace[R];
  }
  if (best0.first >= 0 && best1.first < 0) {
    pair<long long, long long> alone = pair<long long, long long>(-oo, -oo),
                               ver = pair<long long, long long>(-oo, -oo);
    for (long long v : adj[u])
      if (v != par && !Disable[v]) {
        if (dp[v] == best0) continue;
        if (alone.first < hei[v]) {
          alone.second = alone.first;
          alone.first = hei[v];
          ver.second = ver.first;
          ver.first = v;
        } else if (alone.second < hei[v]) {
          alone.second = hei[v];
          ver.second = v;
        }
      }
    pair<long long, long long> val = pair<long long, long long>(
        best0.first + 1, alone.first + alone.second + best0.second + 4);
    if (res < val && val.first >= 0) {
      res = val;
      Pos1 = Trace[R];
      Pos2 = pair<long long, long long>(Home[ver.first], Home[ver.second]);
    }
  }
}
void Centroid_Decompose(long long par, long long u) {
  DFS_CountChild(par, u);
  total = numChild[u];
  long long centroid = Find_centroid(par, u);
  process(par, centroid);
  Disable[centroid] = true;
  for (long long v : adj[centroid])
    if (v != par && !Disable[v]) Centroid_Decompose(centroid, v);
}
void sol() {
  Centroid_Decompose(0, 1);
  cout << Pos1.first << " " << Pos2.first << '\n';
  cout << Pos1.second << " " << Pos2.second << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  cin >> n;
  long long u, v;
  for (long long i = 1; i < n; ++i) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  sol();
  return 0;
}