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 MaxN = 2e5 + 25;
vector<int> v[MaxN];
bool deleted[MaxN];
int pr[MaxN];
int n;
vector<pair<int, int> > best[MaxN];
int val[MaxN];
int dist[MaxN];
pair<int, int> path[MaxN];
void dfs(int x, int p = 0) {
  if (deleted[x]) return;
  pr[x] = p;
  dist[x] = 1 + dist[p];
  for (int to : v[x])
    if (to != p) dfs(to, x);
}
int getFarthest(int x) {
  dfs(x);
  int res = x;
  for (int i = 1; i <= n; ++i)
    if (!deleted[i])
      if (dist[i] > dist[res]) res = i;
  return res;
}
struct T {
  int u, v;
  int len1, len2;
  T() { u = v = len1 = len2 = 0; }
  T(int u, int v, int len1, int len2) : u(u), v(v), len1(len1), len2(len2) {}
  bool operator<(const T& oth) const {
    if (len1 != oth.len1) return len1 < oth.len1;
    if (len2 != oth.len2) return len2 < oth.len2;
    if (u != oth.u) return u < oth.u;
    return v < oth.v;
  }
  bool operator>(const T& oth) const {
    if (len1 != oth.len1) return len1 > oth.len1;
    if (len2 != oth.len2) return len2 > oth.len2;
    if (u != oth.u) return u > oth.u;
    return v > oth.v;
  }
  bool operator==(const T& oth) const {
    return len1 == oth.len1 && len2 == oth.len2 && u == oth.u && v == oth.v;
  }
};
T getBest(int x, int p = 0) {
  if (deleted[x]) return T();
  T res;
  dist[x] = dist[p] + 1;
  for (int to : v[x])
    if (to != p) {
      T t = getBest(to, x);
      if (res < t) res = t;
    }
  if (!res.len2 && val[x])
    res = T(path[x].first, path[x].second, dist[x], val[x]);
  return res;
}
void solve(int x) {
  vector<T> t;
  for (int to : v[x]) t.push_back(getBest(to, x));
  sort(t.begin(), t.end());
  t.resize(unique(t.begin(), t.end()) - t.begin());
  reverse(t.begin(), t.end());
  assert(t.size() > 1);
  cout << t[0].u << ' ' << t[1].u << '\n';
  cout << t[0].v << ' ' << t[1].v << '\n';
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int root;
  for (int i = 1; i <= n; ++i)
    if (v[i].size() > 2) {
      dfs(i);
      root = i;
      break;
    }
  for (int i = 1; i <= n; ++i)
    if (v[i].size() == 1) {
      int x = i, d = 0;
      while (v[x].size() < 3) {
        ++d;
        deleted[x] = true;
        x = pr[x];
      }
      best[x].push_back({d, i});
    }
  for (int i = 1; i <= n; ++i)
    if (!deleted[i] && best[i].size() >= 2) {
      sort(best[i].begin(), best[i].end());
      reverse(best[i].begin(), best[i].end());
      val[i] = best[i][0].first + best[i][1].first;
      path[i] = {best[i][0].second, best[i][1].second};
    }
  int u = getFarthest(root);
  int v = getFarthest(u);
  vector<int> dtr;
  while (v != u) {
    dtr.push_back(v);
    v = pr[v];
  }
  dtr.push_back(u);
  if (dtr.size() == 2) {
    assert(dtr[0] != dtr[1]);
    cout << path[dtr[0]].first << ' ' << path[dtr[1]].first << '\n';
    cout << path[dtr[0]].second << ' ' << path[dtr[1]].second << '\n';
  } else {
    root = dtr[dtr.size() / 2];
    solve(root);
  }
  return 0;
}