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;
using pi = pair<int, int>;
const int MAXN = 200005;
int n, par[MAXN], dep[MAXN];
vector<int> gph[MAXN];
vector<int> dfn;
void dfs(int x) {
  dfn.push_back(x);
  for (auto &i : gph[x]) {
    par[i] = x;
    dep[i] = dep[x] + 1;
    gph[i].erase(find(gph[i].begin(), gph[i].end(), x));
    dfs(i);
  }
}
int L(int x, int y) {
  if (dep[x] > dep[y]) return L(y, x);
  if (x == y) return x;
  return L(x, par[y]);
}
pi dfs2(int x, int p) {
  pi ret(0, x);
  for (auto &i : gph[x]) {
    if (i != p) {
      auto l = dfs2(i, x);
      l.first++;
      ret = max(ret, l);
    }
  }
  return ret;
}
struct Fsomething {
  int first, second;
  int fsomething;
  Fsomething(int x, int y, int z) {
    first = x;
    second = y;
    fsomething = z;
  }
  Fsomething() {}
  bool operator<(const Fsomething &f) const {
    return pi(first, fsomething) < pi(f.first, f.fsomething);
  }
} dp[MAXN], pdp[MAXN];
int far[MAXN], pfar[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int s, e;
    scanf("%d %d", &s, &e);
    gph[s].push_back(e);
    gph[e].push_back(s);
  }
  dfs(1);
  reverse(dfn.begin(), dfn.end());
  for (auto &x : dfn) {
    for (auto &i : gph[x]) {
      far[x] = max(far[x], far[i] + 1);
    }
  }
  reverse(dfn.begin(), dfn.end());
  for (auto &x : dfn) {
    int fmax = 0, fv = x;
    for (auto &i : gph[x]) {
      if (fmax < far[i] + 1) {
        fmax = far[i] + 1;
        fv = i;
      }
    }
    for (auto &i : gph[x]) {
      if (fv == i) {
        for (auto &j : gph[x]) {
          if (i != j) pfar[i] = max(pfar[i], far[j] + 1);
        }
      } else
        pfar[i] = fmax;
      if (x != 1) pfar[i] = max(pfar[i], pfar[x] + 1);
    }
  }
  vector<vector<int>> Fsomethinging(n + 1);
  for (int i = 1; i <= n; i++) {
    for (auto &j : gph[i]) Fsomethinging[i].push_back(far[j]);
    sort(Fsomethinging[i].rbegin(), Fsomethinging[i].rend());
  }
  auto GTFO = [&](int x) { return Fsomethinging[x][0] + Fsomethinging[x][1]; };
  auto GTFO2 = [&](int x) {
    vector<int> v;
    if (par[x] != 1) v.push_back(pfar[par[x]]);
    if (Fsomethinging[x].size() >= 1) v.push_back(Fsomethinging[x][0]);
    if (Fsomethinging[x].size() >= 2) v.push_back(Fsomethinging[x][1]);
    sort(v.rbegin(), v.rend());
    return v[0] + v[1];
  };
  reverse(dfn.begin(), dfn.end());
  for (auto &x : dfn) {
    if (gph[x].size() >= 2)
      dp[x] = Fsomething(0, x, GTFO(x));
    else
      dp[x] = Fsomething(-1e9, 0, -1e9);
    for (auto &j : gph[x]) {
      dp[x] = max(dp[x],
                  Fsomething(dp[j].first + 1, dp[j].second, dp[j].fsomething));
    }
  }
  reverse(dfn.begin(), dfn.end());
  for (auto &x : dfn) {
    if (gph[x].size() == 0) continue;
    Fsomething bburim = Fsomething(-1e9, 0, -1e9);
    if (gph[x].size() + (x != 1) >= 3) bburim = Fsomething(0, x, GTFO2(x));
    if (x != 1)
      bburim = max(bburim, Fsomething(pdp[x].first + 1, pdp[x].second,
                                      pdp[x].fsomething));
    Fsomething cur(-1e9, -1e9, -1e9);
    int curpos;
    for (auto &j : gph[x]) {
      if (cur < dp[j]) {
        cur = dp[j];
        curpos = j;
      }
    }
    Fsomething bburim1 = bburim;
    Fsomething bburim2 = bburim;
    for (auto &j : gph[x]) {
      if (j != curpos) {
        bburim1 = max(bburim1, Fsomething(dp[j].first + 1, dp[j].second,
                                          dp[j].fsomething));
      }
      bburim2 = max(
          bburim2, Fsomething(dp[j].first + 1, dp[j].second, dp[j].fsomething));
    }
    for (auto &j : gph[x]) {
      if (j == curpos)
        pdp[j] = bburim1;
      else
        pdp[j] = bburim2;
    }
  }
  pi maxlen(-1, -1);
  int st = -1, ed = -1;
  for (int i = 2; i <= n; i++) {
    if (pdp[i].first >= 0 && dp[i].first >= 0) {
      int Fsomething111 = pdp[i].first + dp[i].first + 1;
      int Fsomething222 = pdp[i].fsomething + dp[i].fsomething;
      if (maxlen < pi(Fsomething111, Fsomething222)) {
        maxlen = pi(Fsomething111, Fsomething222);
        st = pdp[i].second;
        ed = dp[i].second;
      }
    }
    gph[i].push_back(par[i]);
  }
  int lca = L(st, ed);
  for (int i = st; i != lca; i = par[i]) {
    gph[i].erase(find(gph[i].begin(), gph[i].end(), par[i]));
    gph[par[i]].erase(find(gph[par[i]].begin(), gph[par[i]].end(), i));
  }
  for (int i = ed; i != lca; i = par[i]) {
    gph[i].erase(find(gph[i].begin(), gph[i].end(), par[i]));
    gph[par[i]].erase(find(gph[par[i]].begin(), gph[par[i]].end(), i));
  }
  int st1 = dfs2(st, -1).second;
  int st2 = dfs2(st1, -1).second;
  int ed1 = dfs2(ed, -1).second;
  int ed2 = dfs2(ed1, -1).second;
  printf("%d %d\n%d %d", st1, ed1, st2, ed2);
}