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;
pair<pair<long long, long long>, long long> nodes_selected[200005][4];
long long dp[200005][4], n;
vector<long long> g[200005];
void dfs(int node, int par) {
  nodes_selected[node][3] = make_pair(make_pair(node, node), node);
  nodes_selected[node][2] = make_pair(make_pair(node, node), node);
  nodes_selected[node][1] = make_pair(make_pair(node, node), node);
  for (auto child : g[node]) {
    if (child == par) continue;
    dfs(child, node);
    if (dp[child][3] > dp[node][3]) {
      dp[node][3] = dp[child][3];
      nodes_selected[node][3] = nodes_selected[child][3];
    }
    if (dp[node][2] + dp[child][1] + 1 > dp[node][3]) {
      dp[node][3] = dp[node][2] + dp[child][1] + 1;
      nodes_selected[node][3] =
          make_pair(make_pair(nodes_selected[node][2].first.first,
                              nodes_selected[node][2].first.second),
                    nodes_selected[child][1].first.first);
    }
    if (dp[node][1] + dp[child][2] + 1 > dp[node][3]) {
      dp[node][3] = dp[child][2] + dp[node][1] + 1;
      nodes_selected[node][3] =
          make_pair(make_pair(nodes_selected[child][2].first.first,
                              nodes_selected[child][2].first.second),
                    nodes_selected[node][1].first.first);
    }
    if (dp[node][2] < dp[child][2] + 1) {
      dp[node][2] = dp[child][2] + 1;
      nodes_selected[node][2] = nodes_selected[child][2];
    }
    if (dp[node][2] < dp[node][1] + dp[child][1] + 1) {
      dp[node][2] = dp[node][1] + dp[child][1] + 1;
      nodes_selected[node][2] =
          make_pair(make_pair(nodes_selected[node][1].first.first,
                              nodes_selected[child][1].first.first),
                    -1);
    }
    if (dp[node][1] < dp[child][1] + 1) {
      dp[node][1] = dp[child][1] + 1;
      nodes_selected[node][1] = nodes_selected[child][1];
    }
  }
}
int main() {
  scanf("%lld", &n);
  for (int i = 1; i < n; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  printf("%lld\n", dp[1][3]);
  set<long long> st;
  if (nodes_selected[1][3].first.first > 0)
    st.insert(nodes_selected[1][3].first.first);
  if (nodes_selected[1][3].first.second > 0)
    st.insert(nodes_selected[1][3].first.second);
  if (nodes_selected[1][3].second > 0) st.insert(nodes_selected[1][3].second);
  if (st.size() != 3) {
    for (int i = 1; i <= n; i++) {
      st.insert(i);
      if (st.size() == 3) break;
    }
  }
  for (auto x : st) printf("%lld ", x);
  return 0;
}