Problem: You are given an unweighted tree with n vertices. Recall that a tree is a connected undirected graph without cycles.

Your task is to choose three distinct vertices a, b, c on this tree such that the number of edges which belong to at least one of the simple paths between a and b, b and c, or a and c is the maximum possible. See the notes section for a better understanding.

The simple path is the path that visits each vertex at most once.

Input

The first line contains one integer number n (3 ≤ n ≤ 2 ⋅ 10^5) — the number of vertices in the tree. 

Next n - 1 lines describe the edges of the tree in form a_i, b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i). It is guaranteed that given graph is a tree.

Output

In the first line print one integer res — the maximum number of edges which belong to at least one of the simple paths between a and b, b and c, or a and c.

In the second line print three integers a, b, c such that 1 ≤ a, b, c ≤ n and a ≠, b ≠ c, a ≠ c.

If there are several answers, you can print any.

Example

Input


8
1 2
2 3
3 4
4 5
4 6
3 7
3 8


Output


5
1 8 6

Note

The picture corresponding to the first example (and another one correct answer):

<image>

If you choose vertices 1, 5, 6 then the path between 1 and 5 consists of edges (1, 2), (2, 3), (3, 4), (4, 5), the path between 1 and 6 consists of edges (1, 2), (2, 3), (3, 4), (4, 6) and the path between 5 and 6 consists of edges (4, 5), (4, 6). The union of these paths is (1, 2), (2, 3), (3, 4), (4, 5), (4, 6) so the answer is 5. It can be shown that there is no better answer.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
int n, ans, bestV;
vector<Vi> G;
Vi depth, deep;
void dfs(int v, int p) {
  depth[v] = 0;
  deep[v] = v;
  for (auto& e : (G[v]))
    if (e != p) {
      dfs(e, v);
      if (depth[e] + 1 > depth[v]) {
        depth[v] = depth[e] + 1;
        deep[v] = deep[e];
      }
    }
}
void solve(int v, int p, int up) {
  int gr1 = up, gr2 = 0, gr3 = 0;
  for (auto& e : (G[v]))
    if (e != p) {
      int d = depth[e] + 1;
      if (d >= gr1) {
        gr3 = gr2;
        gr2 = gr1;
        gr1 = d;
      } else if (d >= gr2) {
        gr3 = gr2;
        gr2 = d;
      } else {
        gr3 = max(gr3, d);
      }
    }
  int alt = gr1 + gr2 + gr3;
  if (alt > ans && int((G[v]).size()) >= 2) {
    ans = alt;
    bestV = v;
  }
  for (auto& e : (G[v]))
    if (e != p) {
      int kek = (depth[e] + 1 == gr1 ? gr2 : gr1);
      solve(e, v, kek + 1);
    }
}
void run() {
  cin >> n;
  G.resize(n);
  depth.resize(n);
  deep.resize(n);
  for (int i = (1); i < (n); i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  ans = -1;
  bestV = -1;
  dfs(0, -1);
  solve(0, -1, 0);
  dfs(bestV, -1);
  vector<Pii> tmp;
  for (auto& e : (G[bestV])) tmp.push_back({depth[e], deep[e]});
  sort((tmp).begin(), (tmp).end());
  Vi ret;
  for (int i = (0); i < (min(3, int((tmp).size()))); i++)
    ret.push_back(tmp[int((tmp).size()) - i - 1].second);
  ret.resize(3, bestV);
  cout << ans << '\n';
  for (auto& v : (ret)) cout << v + 1 << ' ';
  cout << '\n';
}