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 SIZE = 1 << 10;
int pointer = SIZE;
char buffer[SIZE];
char Advance() {
  if (pointer == SIZE) {
    fread(buffer, 1, SIZE, stdin);
    pointer = 0;
  }
  return buffer[pointer++];
}
int Read() {
  int answer = 0;
  char ch = Advance();
  while (!isdigit(ch)) ch = Advance();
  while (isdigit(ch)) {
    answer = answer * 10 + ch - '0';
    ch = Advance();
  }
  return answer;
}
const int MAXN = 200000;
int branch0 = 0, length0 = 0;
int a1, b1, a2, b2;
vector<int> g[1 + MAXN];
int down1[1 + MAXN], sonDown1[1 + MAXN], down2[1 + MAXN], sonDown2[1 + MAXN];
int up[1 + MAXN], sonUp[1 + MAXN];
int branch[1 + MAXN], length[1 + MAXN], sonBranch1[1 + MAXN],
    sonBranch2[1 + MAXN], dad[1 + MAXN];
void Down(int node, int father) {
  dad[node] = father;
  for (auto &son : g[node])
    if (son != father) {
      Down(son, node);
      int downNow = down1[son] + 1,
          sonNow = (sonDown1[son] != 0 ? sonDown1[son] : son);
      if (downNow > down1[node]) {
        down2[node] = down1[node];
        sonDown2[node] = sonDown1[node];
        down1[node] = downNow;
        sonDown1[node] = sonNow;
      } else if (downNow > down2[node]) {
        down2[node] = downNow;
        sonDown2[node] = sonNow;
      }
    }
}
void Up(int node, int father) {
  int best1 = 0, which1 = 0, son1 = 0, best2 = 0, which2 = 0, son2 = 0;
  for (auto &son : g[node])
    if (son != father) {
      int bestNow = down1[son] + 2,
          sonNow = (sonDown1[son] != 0 ? sonDown1[son] : son);
      if (bestNow > best1) {
        best2 = best1;
        son2 = son1;
        which2 = which1;
        best1 = bestNow;
        son1 = sonNow;
        which1 = son;
      } else {
        best2 = bestNow;
        son2 = sonNow;
        which2 = son;
      }
    }
  for (auto &son : g[node])
    if (son != father) {
      up[son] = up[node] + 1;
      sonUp[son] = sonUp[node];
      int bestNow = best1, sonNow = son1;
      if (which1 == son) {
        bestNow = best2;
        sonNow = son2;
      }
      if (bestNow > up[son]) {
        up[son] = bestNow;
        sonUp[son] = sonNow;
      }
      Up(son, node);
    }
}
void DFS(int node, int father) {
  for (auto &son : g[node])
    if (son != father) {
      DFS(son, node);
      if (branch[son] &&
          (branch[son] + 1 > branch[node] ||
           (branch[son] + 1 == branch[node] && length[son] > length[node]))) {
        branch[node] = branch[son] + 1;
        length[node] = length[son];
        sonBranch1[node] = sonBranch1[son];
        sonBranch2[node] = sonBranch2[son];
      }
    }
  if (down1[node] && down2[node] &&
      (1 > branch[node] ||
       (1 == branch[node] && down1[node] + down2[node] > length[node]))) {
    branch[node] = 1;
    length[node] = down1[node] + down2[node];
    sonBranch1[node] = sonDown1[node];
    sonBranch2[node] = sonDown2[node];
  }
}
void Solve(int n) {
  for (int node = 1; node <= n; node++) {
    int branch1 = 0, branch2 = 0, length1 = 0, length2 = 0, son11 = 0,
        son12 = 0, son21 = 0, son22 = 0;
    for (auto &son : g[node])
      if (son != dad[node] && branch[son])
        if (branch[son] > branch1 ||
            (branch[son] == branch1 && length[son] > length1)) {
          branch2 = branch1;
          length2 = length1;
          son21 = son11;
          son22 = son12;
          branch1 = branch[son];
          length1 = length[son];
          son11 = sonBranch1[son];
          son12 = sonBranch2[son];
        } else if (branch[son] > branch2 ||
                   (branch[son] == branch2 && length[son] > length2)) {
          branch2 = branch[son];
          length2 = length[son];
          son21 = sonBranch1[son];
          son22 = sonBranch2[son];
        }
    if (branch1 && branch2) {
      if (branch1 + branch2 + 1 > branch0 ||
          (branch1 + branch2 + 1 == branch0 && length1 + length2 > length0)) {
        branch0 = branch1 + branch2 + 1;
        length0 = length1 + length2;
        a1 = son11;
        a2 = son12;
        b1 = son21;
        b2 = son22;
      }
      continue;
    }
    int best1 = 0, son1 = 0, best2 = 0, son2 = 0;
    for (auto &son : g[node])
      if (son != dad[node] && branch[son] == 0) {
        int downNow = down1[son] + 1,
            sonNow = (sonDown1[son] != 0 ? sonDown1[son] : son);
        if (downNow > best1) {
          best2 = best1;
          son2 = son1;
          best1 = downNow;
          son1 = sonNow;
        } else if (downNow > best2) {
          best2 = downNow;
          son2 = sonNow;
        }
      }
    if (up[node])
      if (up[node] > best1) {
        best2 = best1;
        son2 = son1;
        best1 = up[node];
        son1 = sonUp[node];
      } else if (up[node] > best2) {
        best2 = up[node];
        son2 = sonUp[node];
      }
    if (best1 && best2)
      if (branch1 + 1 > branch0 ||
          (branch1 + 1 == branch0 && length1 + best1 + best2 > length0)) {
        branch0 = branch1 + 1;
        length0 = length1 + best1 + best2;
        a1 = son11;
        a2 = son12;
        b1 = son1;
        b2 = son2;
      }
  }
}
int main() {
  int n = Read();
  for (int i = 1; i < n; i++) {
    int a = Read(), b = Read();
    g[a].push_back(b);
    g[b].push_back(a);
  }
  Down(1, 0);
  Up(1, 0);
  DFS(1, 0);
  Solve(n);
  printf("%d %d\n%d %d\n", a1, b1, a2, b2);
  return 0;
}