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 namespace std::chrono;
pair<long long int, long long int> dfs(vector<long long int> edges[],
                                       long long int u, long long int p,
                                       vector<long long int>& parent) {
  pair<long long int, long long int> pa = {u, 0};
  parent[u] = p;
  for (long long int v : edges[u]) {
    if (v != p) {
      pair<long long int, long long int> child = dfs(edges, v, u, parent);
      long long int dis1 = child.second + 1;
      if (dis1 > pa.second) {
        pa = {child.first, dis1};
      }
    }
  }
  return pa;
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> edges[n];
  for (long long int x = 0; x < n - 1; x++) {
    long long int u, v;
    cin >> u >> v;
    u--;
    v--;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  vector<long long int> parent(n);
  pair<long long int, long long int> pa1 = dfs(edges, 0, 0, parent);
  pair<long long int, long long int> pa2 =
      dfs(edges, pa1.first, pa1.first, parent);
  if (pa2.second == n - 1) {
    cout << pa2.second << "\n";
    cout << pa1.first + 1 << " " << pa2.first + 1 << " ";
    long long int u = 0;
    while (u == pa1.first || u == pa2.first) {
      u++;
    }
    cout << u + 1 << "\n";
    return 0;
  }
  queue<long long int> q;
  vector<long long int> distance(n, (long long int)1e18 + 1);
  long long int par = parent[pa2.first];
  q.push(pa2.first);
  distance[pa2.first] = 0;
  while (par != pa1.first) {
    distance[par] = 0;
    q.push(par);
    par = parent[par];
  }
  distance[pa1.first] = 0;
  q.push(pa1.first);
  while (!q.empty()) {
    long long int u = q.front();
    q.pop();
    for (long long int v : edges[u]) {
      if (distance[v] > distance[u] + 1) {
        distance[v] = distance[u] + 1;
        q.push(v);
      }
    }
  }
  long long int maxi = 0;
  for (long long int x = 0; x < n; x++) {
    if (distance[maxi] < distance[x]) {
      maxi = x;
    }
  }
  cout << pa2.second + distance[maxi] << "\n";
  cout << pa1.first + 1 << " " << pa2.first + 1 << " " << maxi + 1 << "\n";
  return 0;
}