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 <class X, class Y>
void amin(X& x, const Y& y) {
  if (x > y) x = y;
}
template <class X, class Y>
void amax(X& x, const Y& y) {
  if (x < y) x = y;
}
const int INF = 1e9 + 10;
const long long INFL = (long long)1e18 + 10;
const int MAX = 2e5 + 10;
int n;
vector<int> es[MAX];
int mx1[MAX];
pair<int, pair<int, int> > mx2[MAX];
int pmx[MAX];
int rshare, rlen;
pair<int, int> r1, r2;
pair<int, pair<int, int> > zero;
int limit;
int h[MAX];
int lca[22][MAX];
void visit_lca(int u, int p) {
  h[u] = h[p] + 1;
  lca[0][u] = p;
  limit = max(limit, h[u]);
  for (auto v : es[u])
    if (v != p) visit_lca(v, u);
}
void build_lca() {
  visit_lca(1, 0);
  limit = (int)log2(limit) + 1;
  for (int i = 1; i <= limit; i++)
    for (int j = 1; j <= n; j++) lca[i][j] = lca[i - 1][lca[i - 1][j]];
}
int getlca(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  for (int i = limit; i >= 0; i--)
    if (h[lca[i][v]] >= h[u]) v = lca[i][v];
  if (u == v) return u;
  for (int i = limit; i >= 0; i--)
    if (lca[i][u] != lca[i][v]) {
      u = lca[i][u];
      v = lca[i][v];
    }
  return lca[0][u];
}
int getlen(int u, int v) {
  if (u == 0 || v == 0) return 0;
  int x = getlca(u, v);
  return h[u] + h[v] - 2 * h[x];
}
void check0() {
  bool has3 = false;
  for (int i = 1; i <= n; i++)
    if ((int(es[i].size())) > 2) {
      has3 = true;
      break;
    }
  if (has3) return;
  vector<int> start;
  for (int i = 1; i <= n; i++)
    if ((int(es[i].size())) == 1) start.push_back(i);
  pair<int, int> p1, p2;
  p1 = make_pair(start[0], es[start[0]][0]);
  p2.first = es[p1.second][0] == p1.first ? es[p1.second][1] : es[p1.second][0];
  p2.second = start[1];
  cout << p1.first << " " << p1.second << '\n';
  cout << p2.first << " " << p2.second << '\n';
  exit(0);
}
void check1() {
  int cnt3 = 0;
  for (int i = 1; i <= n; i++)
    if ((int(es[i].size())) > 2) cnt3++;
  if (cnt3 > 1) return;
  int start = 0;
  for (int i = 1; i <= n; i++)
    if ((int(es[i].size())) > 2) {
      start = i;
      break;
    }
  vector<pair<int, int> > end;
  for (auto u : es[start]) {
    int x = u;
    int last = start;
    while ((int(es[u].size())) > 1) {
      int v = es[u][0] == last ? es[u][1] : es[u][0];
      last = u;
      u = v;
    }
    end.push_back(make_pair(u, getlen(x, u)));
  }
  if ((int(es[start].size())) == 3) {
    cout << end[0].first << " " << end[1].first << '\n';
    cout << es[start][2] << " " << end[2].first << '\n';
  } else {
    sort(end.begin(), end.end(),
         [](const pair<int, int>& ls, const pair<int, int>& rs) {
           return ls.second > rs.second;
         });
    cout << end[0].first << " " << end[1].first << '\n';
    cout << end[2].first << " " << end[3].first << '\n';
  }
  exit(0);
}
bool comp(int u, const pair<int, pair<int, int> >& ls,
          const pair<int, pair<int, int> >& rs) {
  if (ls.first != rs.first) return ls.first < rs.first;
  return getlen(u, ls.second.first) + getlen(u, ls.second.second) <=
         getlen(u, rs.second.first) + getlen(u, rs.second.second);
}
void visit1(int u, int p) {
  for (auto v : es[u])
    if (v != p) visit1(v, u);
  mx1[u] = u;
  for (auto v : es[u])
    if (v != p && getlen(u, mx1[u]) < getlen(u, mx1[v])) mx1[u] = mx1[v];
}
void visit2(int u, int p) {
  int v1, v2;
  if (pmx[u] == 0) {
    v1 = u;
    v2 = 0;
  } else {
    v1 = pmx[u];
    v2 = u;
  }
  for (auto v : es[u])
    if (v != p) {
      if (getlen(u, v1) <= getlen(u, mx1[v])) {
        v2 = v1;
        v1 = mx1[v];
      } else if (getlen(u, v2) <= getlen(u, mx1[v])) {
        v2 = mx1[v];
      }
    }
  for (auto v : es[u])
    if (v != p) {
      pmx[v] = mx1[v] == v1 ? v2 : v1;
      visit2(v, u);
    }
}
void visit3(int u, int p) {
  for (auto v : es[u])
    if (v != p) visit3(v, u);
  int v1 = 0, v2 = 0, v3 = 0;
  for (auto v : es[u])
    if (v != p) {
      if (getlen(u, v1) <= getlen(u, mx1[v])) {
        v3 = v2;
        v2 = v1;
        v1 = mx1[v];
      } else if (getlen(u, v2) <= getlen(u, mx1[v])) {
        v3 = v2;
        v2 = mx1[v];
      } else if (getlen(u, v3) <= getlen(u, mx1[v]))
        v3 = mx1[v];
    }
  if (v1 != 0 && v2 != 0) mx2[u] = make_pair(1, make_pair(v1, v2));
  for (auto v : es[u])
    if (v != p && mx2[v] != zero &&
        comp(u, mx2[u], make_pair(mx2[v].first + 1, mx2[v].second)))
      mx2[u] = make_pair(mx2[v].first + 1, mx2[v].second);
  if (getlen(u, v1) <= getlen(u, pmx[u])) {
    v3 = v2;
    v2 = v1;
    v1 = pmx[u];
  } else if (getlen(u, v2) <= getlen(u, pmx[u])) {
    v3 = v2;
    v2 = pmx[u];
  } else if (getlen(u, v3) <= getlen(u, pmx[u])) {
    v3 = pmx[u];
  }
  for (auto v : es[u])
    if (v != p && mx2[v] != zero && mx2[v].first + 1 >= rshare) {
      int x1 = 0, x2 = 0;
      if (mx1[v] == v1) {
        x1 = v2;
        x2 = v3;
      } else if (mx1[v] == v2) {
        x1 = v1;
        x2 = v3;
      } else {
        x1 = v1;
        x2 = v2;
      }
      if (x1 == 0 || x2 == 0) continue;
      int l = getlen(u, mx2[v].second.first) + getlen(u, mx2[v].second.second) +
              getlen(u, x1) + getlen(u, x2);
      if (mx2[v].first + 1 > rshare || l > rlen) {
        rshare = mx2[v].first + 1;
        rlen = l;
        r1 = make_pair(x1, mx2[v].second.first);
        r2 = make_pair(x2, mx2[v].second.second);
      }
    }
  pair<int, pair<int, int> > p1 = zero, p2 = zero;
  for (auto v : es[u])
    if (v != p && mx2[v] != zero) {
      if (p1 == zero || comp(u, p1, mx2[v])) {
        p2 = p1;
        p1 = mx2[v];
      } else if (p2 == zero || comp(u, p2, mx2[v]))
        p2 = mx2[v];
    }
  if (p1 != zero && p2 != zero && p1.first + p2.first + 1 >= rshare) {
    int l = getlen(u, p1.second.first) + getlen(u, p1.second.second) +
            getlen(u, p2.second.first) + getlen(u, p2.second.second);
    if (p1.first + p2.first + 1 > rshare || l > rlen) {
      rshare = p1.first + p2.first + 1;
      rlen = l;
      r1 = make_pair(p1.second.first, p2.second.first);
      r2 = make_pair(p1.second.second, p2.second.second);
    }
  }
}
void process() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    es[u].push_back(v);
    es[v].push_back(u);
  }
  build_lca();
  check0();
  check1();
  visit1(1, 0);
  visit2(1, 0);
  visit3(1, 0);
  cout << r1.first << " " << r1.second << '\n';
  cout << r2.first << " " << r2.second << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  process();
}