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 double eps = 1e-13;
const long double PI = acos(-1);
const int INF = (int)1e9 + 7;
const long long INFF = (long long)2e18;
const int mod = (int)1e9 + 7;
const int MXN = (int)2e5 + 7;
int dep[MXN];
struct node {
  int v, f1, f2, l;
  node(){};
  node(int _v, int _f1, int _f2) {
    v = _v, f1 = _f1, f2 = _f2;
    l = dep[f1] + dep[f2] - 2 * dep[v];
  }
  const bool operator<(const node &p2) const {
    if (dep[v] != dep[p2.v]) return dep[v] < dep[p2.v];
    return l < p2.l;
  }
};
vector<int> edge[MXN];
int bst[MXN][2];
int in[MXN], out[MXN], cntp;
void dfs(int u, int pa, int dpt) {
  dep[u] = dpt;
  bst[u][0] = bst[u][1] = u;
  in[u] = ++cntp;
  for (int v : edge[u]) {
    if (v == pa) continue;
    dfs(v, u, dpt + 1);
    if (dep[bst[v][0]] > dep[bst[u][0]]) {
      bst[u][1] = bst[u][0];
      bst[u][0] = bst[v][0];
    } else if (dep[bst[v][0]] > dep[bst[u][1]]) {
      bst[u][1] = bst[v][0];
    }
  }
  out[u] = cntp;
}
int d1, d2;
int s1, e1, s2, e2;
node dp[MXN];
int ck(int u, int v) {
  if (in[v] <= in[u] && out[u] <= out[v]) return true;
  return false;
}
void dfs2(int u, int pa, int dis, int fr) {
  for (int v : edge[u]) {
    if (v == pa) continue;
    if (in[v] <= in[bst[u][0]] && out[bst[u][0]] <= out[v]) {
      if (dis > dep[bst[u][1]] - dep[u])
        dfs2(v, u, dis + 1, fr);
      else
        dfs2(v, u, dep[bst[u][1]] - dep[u] + 1, bst[u][1]);
    } else {
      if (dis > dep[bst[u][0]] - dep[u])
        dfs2(v, u, dis + 1, fr);
      else
        dfs2(v, u, dep[bst[u][0]] - dep[u] + 1, bst[u][0]);
    }
    if (dp[v].v == 0) continue;
    if (dis && bst[u][0] != u && !ck(bst[u][0], v)) {
      int v1 = dep[dp[v].v] - dep[u];
      int v2 = dis + dep[bst[u][0]] - dep[u] + dp[v].l;
      if (d1 < v1 || (d1 == v1 && d2 < v2)) {
        d1 = v1, d2 = v2;
        s1 = fr, e1 = bst[u][0];
        s2 = dp[v].f1, e2 = dp[v].f2;
      }
    }
    if (dis && bst[u][1] != u && !ck(bst[u][1], v)) {
      int v1 = dep[dp[v].v] - dep[u];
      int v2 = dis + dep[bst[u][1]] - dep[u] + dp[v].l;
      if (d1 < v1 || (d1 == v1 && d2 < v2)) {
        d1 = v1, d2 = v2;
        s1 = fr, e1 = bst[u][1];
        s2 = dp[v].f1, e2 = dp[v].f2;
      }
    }
    if (dp[u].v) {
      int v1 = dep[dp[u].v] + dep[dp[v].v] - 2 * dep[u];
      int v2 = dp[u].l + dp[v].l;
      if (d1 < v1 || (d1 == v1 && d2 < v2)) {
        d1 = v1, d2 = v2;
        s1 = dp[u].f1, e1 = dp[u].f2;
        s2 = dp[v].f1, e2 = dp[v].f2;
      }
    }
    if (dp[u] < dp[v]) {
      dp[u] = dp[v];
    }
  }
  if (dp[u].v == 0 && bst[u][0] != u && bst[u][1] != u) {
    dp[u] = node(u, bst[u][0], bst[u][1]);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  int rt = 0;
  for (int i = 1; i <= n; i++)
    if ((int)(edge[i]).size() == 1) rt = i;
  dfs(rt, 0, 1);
  dfs2(rt, 0, 0, rt);
  printf("%d %d\n%d %d\n", s1, e2, s2, e1);
  return 0;
}