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 = 2e5 + 7;
vector<int> g[N];
int pr[N];
bool used[N];
vector<int> best[N];
int d[N];
void fsd(int u, int p = -1) {
  d[u] = 0;
  for (auto v : g[u]) {
    if (v != p) {
      fsd(v, u);
      d[u] = max(d[u], d[v] + 1);
    }
  }
}
void jhfs(int u, int p = -1, int bst = 0) {
  int a = -1, b = -1;
  for (auto v : g[u]) {
    if (v != p) {
      if (a == -1 || d[a] < d[v]) {
        b = a;
        a = v;
      } else if (b == -1 || d[b] < d[v]) {
        b = v;
      }
    }
  }
  for (int i = 0; i < g[u].size(); ++i) {
    if (g[u][i] != p) {
      best[u][i] = d[g[u][i]];
      if (g[u][i] == a) {
        if (b == -1) {
          jhfs(g[u][i], u, bst + 1);
        } else {
          jhfs(g[u][i], u, max(bst + 1, d[b] + 1));
        }
      } else {
        jhfs(g[u][i], u, max(bst + 1, d[a] + 1));
      }
    } else {
      best[u][i] = bst;
    }
  }
}
int ans = -1;
int ansa = -1, ansb = -1, ansc = -1, ansd = -1;
int anss = -1;
int wha = -1, whb = -1;
int cur;
int a, b, w;
int who;
void dfs_centroid(int u, int d, int p) {
  int cnt = 0;
  for (auto v : g[u]) {
    if (v != p && !used[v]) {
      ++cnt;
      dfs_centroid(v, d + 1, u);
    }
  }
  if (cnt >= 2) {
    int mx1 = -1, mx2 = -1;
    int ta = -1, tb = -1;
    for (int i = 0; i < g[u].size(); ++i) {
      if (g[u][i] != p) {
        if (best[u][i] > mx1) {
          tb = ta;
          ta = g[u][i];
          mx2 = mx1;
          mx1 = best[u][i];
        } else if (best[u][i] > mx2) {
          tb = g[u][i];
          mx2 = best[u][i];
        }
      }
    }
    int sum = mx1 + mx2;
    if (d > cur || (d == cur && sum > w)) {
      cur = d;
      who = u;
      w = sum;
      a = ta;
      b = tb;
    }
  }
}
int dfs(int u, int size, int &c, int p = -1) {
  int sum = 1;
  for (auto v : g[u]) {
    if (v != p && !used[v]) {
      sum += dfs(v, size, c, u);
    }
  }
  if (c == -1 && (2 * sum >= size || p == -1)) {
    c = u;
  }
  return sum;
}
void build(int u, int size, int last = -1) {
  int c = -1;
  dfs(u, size, c);
  pr[c] = last;
  used[c] = 1;
  int f = -1, s = -1, t = -1;
  for (int i = 0; i < g[c].size(); ++i) {
    int v = g[c][i];
    if (!used[v]) {
      if (f == -1 || best[c][i] > f) {
        t = s;
        s = f;
        f = i;
      } else if (s == -1 || best[c][i] > s) {
        t = s;
        s = i;
      } else if (t == -1 || best[c][i] > t) {
        t = i;
      }
    }
  }
  int mx1 = -1, mx1a = -1, mx1b = -1, mx1s = -1, mx2 = -1, mx2a = -1, mx2b = -1,
      mx2s = -1, mx1wh = -1, mx2wh = -1;
  int idx = 0;
  for (auto v : g[c]) {
    if (!used[v]) {
      cur = -1, a = -1, b = -1, w = -1, who = -1;
      dfs_centroid(v, 1, c);
      if (f != -1 && s != -1 && t != -1) {
        int wa = -1, wb = -1;
        int summa = 0;
        if (f == idx) {
          summa += best[c][s];
          summa += best[c][t];
          wa = g[c][s];
          wb = g[c][t];
        } else if (s == idx) {
          summa += best[c][f];
          summa += best[c][t];
          wa = g[c][f];
          wb = g[c][t];
        } else {
          summa += best[c][f];
          summa += best[c][s];
          wa = g[c][f];
          wb = g[c][s];
        }
        if (cur > ans || (cur == ans && summa + w > anss)) {
          ans = cur;
          anss = summa + w;
          ansa = a;
          ansb = b;
          ansc = wa;
          ansd = wb;
          wha = who;
          whb = c;
        }
      }
      if (mx1 < cur || (mx1 == cur && mx1s < w)) {
        mx2 = mx1;
        mx2s = mx1s;
        mx2a = mx1a;
        mx2b = mx1b;
        mx2wh = mx1wh;
        mx1 = cur;
        mx1s = w;
        mx1a = a;
        mx1b = b;
        mx1wh = who;
      } else if (mx2 < cur || (mx2 == cur && mx2s < w)) {
        mx2 = cur;
        mx2s = w;
        mx2a = a;
        mx2b = b;
        mx2wh = who;
      }
    }
    ++idx;
  }
  if (mx1 != -1 && mx2 != -1) {
    if (mx1 + mx2 > ans || (mx1 + mx2 == ans && mx1s + mx2s > anss)) {
      ans = mx1 + mx2;
      anss = mx1s + mx2s;
      ansa = mx1a;
      ansb = mx1b;
      ansc = mx2a;
      ansd = mx2b;
      wha = mx1wh;
      whb = mx2wh;
    }
  }
  for (auto v : g[c]) {
    if (!used[v]) {
      build(v, (size + 1) / 2, c);
    }
  }
}
pair<int, int> find(int u, int p) {
  pair<int, int> cur = {u, 0};
  for (auto v : g[u]) {
    if (v != p) {
      auto pr = find(v, u);
      if (pr.second + 1 > cur.second) {
        cur = pr;
        ++cur.second;
      }
    }
  }
  return cur;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 0; i + 1 < n; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) {
    best[i].resize(g[i].size());
  }
  fsd(0);
  jhfs(0);
  build(0, n);
  ansa = find(ansa, wha).first + 1;
  ansb = find(ansb, wha).first + 1;
  ansc = find(ansc, whb).first + 1;
  ansd = find(ansd, whb).first + 1;
  cout << ansa << ' ' << ansc << '\n' << ansb << ' ' << ansd << '\n';
}