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;
struct aaa {
  int x, y;
} a[500010];
int n, tot, cnt, ans, ha[500010], e[500010], hd[500010], nt[500010], sej, xx0,
    xx1, yy0, yy1, f[500010], len[500010], fr[500010][2], v[500010], mx[500010],
    cmx[500010], h[500010], ch[500010], g[500010], id[500010], cid[500010],
    hh[500010];
void build(int x, int y) {
  tot++;
  e[tot] = y;
  nt[tot] = hd[x];
  hd[x] = tot;
}
bool cmp(aaa a, aaa b) { return a.x > b.x; }
void ycl(int x, int fa) {
  int i;
  for (i = hd[x]; i; i = nt[i]) {
    if (e[i] == fa) continue;
    ycl(e[i], x);
    if (mx[e[i]] > mx[x]) {
      cmx[x] = mx[x];
      mx[x] = mx[e[i]];
      cid[x] = id[x];
      id[x] = e[i];
      ch[x] = h[x];
      h[x] = h[e[i]];
    } else if (mx[e[i]] > cmx[x]) {
      cmx[x] = mx[e[i]];
      cid[x] = e[i];
      ch[x] = h[e[i]];
    }
  }
  if (mx[x])
    mx[x]++;
  else
    mx[x] = 1, id[x] = x, h[x] = x;
  if (cmx[x]) cmx[x]++;
}
void dfs1(int x, int fa, int la, int xx) {
  int i;
  g[x] = la;
  hh[x] = xx;
  for (i = hd[x]; i; i = nt[i]) {
    if (e[i] == fa) continue;
    if (id[x] == e[i]) {
      if (max(la + 1, cmx[x]) == 1)
        dfs1(e[i], x, 1, x);
      else if (la + 1 > cmx[x])
        dfs1(e[i], x, max(la + 1, cmx[x]), xx);
      else
        dfs1(e[i], x, cmx[x], ch[x]);
    } else {
      if (max(la + 1, mx[x]) == 1)
        dfs1(e[i], x, 1, x);
      else if (la + 1 > mx[x])
        dfs1(e[i], x, max(la + 1, mx[x]), xx);
      else
        dfs1(e[i], x, mx[x], h[x]);
    }
  }
}
void dfs(int x, int fa) {
  int i, flag = 0, oo = 0;
  for (i = hd[x]; i; i = nt[i]) {
    if (e[i] == fa) continue;
    dfs(e[i], x);
    if (f[x] && f[e[i]]) {
      oo = 1;
      if (f[x] + f[e[i]] > ans ||
          f[x] + f[e[i]] == ans && len[x] + len[e[i]] > sej) {
        sej = len[x] + len[e[i]];
        ans = f[x] + f[e[i]];
        xx0 = fr[x][0];
        xx1 = fr[x][1];
        yy0 = fr[e[i]][0];
        yy1 = fr[e[i]][1];
      }
    }
    if (v[e[i]]) {
      if (f[e[i]] + 1 > f[x] ||
          f[e[i]] + 1 == f[x] && len[e[i]] + 2 >= len[x]) {
        f[x] = f[e[i]] + 1;
        len[x] = len[e[i]] + 2;
        fr[x][0] = fr[e[i]][0];
        fr[x][1] = fr[e[i]][1];
      }
    }
    v[x] |= v[e[i]];
    flag++;
  }
  if (f[x] && !oo) {
    cnt = 0;
    for (i = hd[x]; i; i = nt[i]) {
      if (f[e[i]]) continue;
      if (e[i] == fa)
        a[++cnt].x = g[x], a[cnt].y = hh[x];
      else
        a[++cnt].x = len[e[i]], a[cnt].y = ha[e[i]];
    }
    if (cnt >= 2) {
      sort(a + 1, a + cnt + 1, cmp);
      if (f[x] > ans || f[x] == ans && len[x] + a[1].x + a[2].x + 4 >= sej) {
        ans = f[x];
        sej = len[x] + a[1].x + a[2].x + 4;
        xx0 = fr[x][0];
        xx1 = fr[x][1];
        yy0 = a[1].y;
        yy1 = a[2].y;
      }
    }
  }
  if (!flag)
    len[x] = 1, ha[x] = x;
  else if (!v[x]) {
    if (flag > 1) {
      cnt = 0;
      for (i = hd[x]; i; i = nt[i]) {
        if (e[i] == fa) continue;
        a[++cnt].x = len[e[i]];
        a[cnt].y = ha[e[i]];
      }
      sort(a + 1, a + cnt + 1, cmp);
      v[x] = 1;
      fr[x][0] = a[1].y;
      fr[x][1] = a[2].y;
      f[x] = 1;
      len[x] = a[1].x + a[2].x + 1;
    } else {
      for (i = hd[x]; i; i = nt[i]) {
        if (e[i] == fa) continue;
        len[x] = len[e[i]] + 1;
        ha[x] = ha[e[i]];
      }
    }
  }
  if (x != 1) flag++;
  if (flag >= 4) {
    for (i = hd[x]; i; i = nt[i]) {
      if (e[i] == fa)
        a[++cnt].x = g[x], a[cnt].y = hh[x];
      else
        a[++cnt].x = len[e[i]], a[cnt].y = ha[e[i]];
    }
    sort(a + 1, a + cnt + 1, cmp);
    if (ans == 0 || ans == 1 && a[1].x + a[2].x + a[3].x + a[4].x + 4 >= sej) {
      ans = 1;
      sej = a[1].x + a[2].x + a[3].x + a[4].x + 4;
      xx0 = a[1].y;
      xx1 = a[2].y;
      yy0 = a[3].y;
      yy1 = a[4].y;
    }
  }
}
int main() {
  int i, x, y;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    build(x, y);
    build(y, x);
  }
  ycl(1, 0);
  dfs1(1, 0, 0, 0);
  dfs(1, 0);
  printf("%d %d\n%d %d", xx0, yy0, xx1, yy1);
}