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 N = 200 * 1000 + 11;
int n;
vector<int> g[N];
int p[N];
int dist[N];
bool bad[N];
int value[N];
pair<int, int> res[N];
vector<pair<int, int> > best[N];
void dfs(int v, int par = -1, int d = 0) {
  p[v] = par;
  dist[v] = d;
  for (auto to : g[v]) {
    if (to == par) {
      continue;
    }
    dfs(to, v, d + 1);
  }
}
int getFarthest(int v) {
  dfs(v);
  int res = v;
  for (int i = 0; i < n; ++i) {
    if (bad[i]) {
      continue;
    }
    if (dist[res] < dist[i]) {
      res = i;
    }
  }
  return res;
}
pair<int, int> get(int v) { return {dist[v], value[v]}; }
int getBetter(int v, int u) {
  if (get(v) > get(u)) {
    return v;
  }
  return u;
}
int getBest(int v, int par) {
  int res = v;
  for (auto to : g[v]) {
    if (to == par || bad[to]) {
      continue;
    }
    res = getBetter(res, getBest(to, v));
  }
  return res;
}
pair<int, int> calc(int v) {
  dfs(v);
  vector<int> ch;
  for (auto to : g[v]) {
    if (!bad[to]) {
      ch.push_back(to);
    }
  }
  if (int((ch).size()) == 1) {
    return {v, ch[0]};
  }
  vector<int> pref(int((ch).size()));
  vector<int> suf(int((ch).size()));
  vector<int> best(int((ch).size()));
  for (int i = 0; i < int((ch).size()); ++i) {
    int to = ch[i];
    best[i] = pref[i] = suf[i] = getBest(to, v);
  }
  for (int i = 1; i < int((ch).size()); ++i) {
    pref[i] = getBetter(pref[i], pref[i - 1]);
    suf[int((ch).size()) - i - 1] =
        getBetter(suf[int((ch).size()) - i - 1], suf[int((ch).size()) - i]);
  }
  pair<int, int> ans = {-1, -1};
  pair<int, int> res = {0, 0};
  for (int i = 0; i < int((ch).size()); ++i) {
    int bst = -1;
    if (i == 0) {
      bst = suf[i + 1];
    } else if (i + 1 == int((ch).size())) {
      bst = pref[i - 1];
    } else {
      bst = getBetter(pref[i - 1], suf[i + 1]);
    }
    pair<int, int> curRes = {dist[bst] + dist[best[i]],
                             value[bst] + value[best[i]]};
    if (res < curRes) {
      res = curRes;
      ans = {best[i], bst};
    }
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int first, second;
    cin >> first >> second;
    --first, --second;
    g[first].push_back(second);
    g[second].push_back(first);
  }
  int root = -1;
  for (int i = 0; i < n; ++i) {
    if (int((g[i]).size()) > 2) {
      root = i;
      dfs(i);
      break;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (int((g[i]).size()) != 1) {
      continue;
    }
    int v = i;
    while (int((g[v]).size()) < 3) {
      bad[v] = true;
      v = p[v];
    }
    best[v].push_back({dist[i] - dist[v], i});
  }
  for (int i = 0; i < n; ++i) {
    if (int((best[i]).size()) >= 2) {
      sort(best[i].rbegin(), best[i].rend());
      value[i] = best[i][0].first + best[i][1].first;
      res[i] = {best[i][0].second, best[i][1].second};
    }
  }
  int u = getFarthest(root);
  int v = getFarthest(u);
  vector<int> path;
  while (v != u) {
    path.push_back(v);
    v = p[v];
  }
  path.push_back(u);
  pair<int, int> ans = calc(path[int((path).size()) / 2]);
  printf("%d %d\n", res[ans.first].first + 1, res[ans.second].first + 1);
  printf("%d %d\n", res[ans.first].second + 1, res[ans.second].second + 1);
  return 0;
}