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;
template <typename T>
inline bool upmin(T &x, T y) {
  return y <= x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x <= y ? x = y, 1 : 0;
}
const long double eps = 1e-9;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 60;
const int MAXN = 200005;
const int MAXM = 2000005;
const int MX = 5000;
const int mods = 998244353;
const int SZ = 131;
const int inv2 = (mods + 1) >> 1;
const int INF = 0x3f3f3f3f;
namespace FastIO {
constexpr int SIZE = (1 << 21) + 1;
int num = 0, f;
char ibuf[SIZE], obuf[SIZE], que[65], *iS, *iT, *oS = obuf,
                                                *oT = obuf + SIZE - 1, c;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char c) {
  *oS++ = c;
  if (oS == oT) flush();
}
inline void getc(char &c) {
  for (c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       !isalpha(c) && c != EOF;
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    ;
}
inline void reads(char *st) {
  char c;
  int n = 0;
  getc(st[++n]);
  for (c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       isalpha(c);
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    st[++n] = c;
  st[++n] = '\0';
}
template <class I>
inline void read(I &x) {
  for (f = 1, c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-') f = -1;
  for (x = 0; c >= '0' && c <= '9';
       c = (iS == iT ? (iT = ((iS = ibuf) + fread(ibuf, 1, SIZE, stdin)),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = (x << 3) + (x << 1) + (c & 15);
  x *= f;
}
template <class I>
inline void print(I x) {
  if (x < 0) putc('-'), x = -x;
  if (!x) putc('0');
  while (x) que[++num] = x % 10 + 48, x /= 10;
  while (num) putc(que[num--]);
}
inline void putstr(string st) {
  for (int i = 0; i < (int)st.size(); ++i) putc(st[i]);
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_Flusher_;
}  // namespace FastIO
using FastIO ::print;
using FastIO ::putc;
using FastIO ::putstr;
using FastIO ::read;
using FastIO ::reads;
int head[200010], cnt;
struct Edge {
  int to, nxt;
} e[200010 << 1];
inline void add(int a, int b) {
  e[++cnt] = (Edge){b, head[a]};
  head[a] = cnt;
}
bool choose[200010];
int ind[200010];
int n, root;
struct node {
  int P, M;
  inline node() {}
  inline node(int __P, int __M) { M = __M, P = __P; }
  inline node operator+(const int &rhs) const { return node(P, M + rhs); }
  inline friend bool operator<(const node &lhs, const node &rhs) {
    return lhs.M < rhs.M;
  }
} V[200010][2];
void dfs(int u, int fa = 0) {
  if (ind[u] > 1) choose[u] = true;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v != fa) {
      dfs(v, u);
      if (ind[u] == 2 && !choose[v]) choose[u] = false;
    }
  }
}
int f[200010], F[200010];
node dfs1(int u, int fa = 0) {
  V[u][0] = node(u, 0);
  V[u][1] = node(0, 0);
  f[F[u] = u] = choose[u];
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v != fa) {
      node tmp = dfs1(v, u) + 1;
      if (f[v] + choose[u] > f[u]) {
        f[u] = f[v] + choose[u];
        F[u] = F[v];
      } else if (f[v] + choose[u] == f[u]) {
        if (choose[v] &&
            V[F[u]][1].M + V[F[u]][0].M <= V[F[v]][1].M + V[F[v]][0].M) {
          F[u] = F[v];
        }
      }
      if (V[u][0] < tmp) {
        V[u][1] = V[u][0];
        V[u][0] = tmp;
      } else if (V[u][1] < tmp)
        V[u][1] = tmp;
    }
  }
  return V[u][0];
}
int main() {
  read(n);
  for (int i = 1, a, b; i < n; i++) {
    read(a), read(b);
    add(a, b);
    add(b, a);
    ind[a]++, ind[b]++;
    if (ind[a] >= 3) root = a;
    if (ind[b] >= 3) root = b;
  }
  dfs(root);
  int x, a, b, c, d;
  dfs1(root);
  x = F[root], a = V[F[root]][0].P, c = V[F[root]][1].P;
  dfs1(x);
  b = V[F[x]][0].P, d = V[F[x]][1].P;
  print(a), putc(' '), print(b), putc('\n'), print(c), putc(' '), print(d),
      putc('\n');
  return 0;
}