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;
long long min(long long a, long long b) { return a > b ? b : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
vector<int> gr[200005];
int depth[200005] = {0};
int a = 0, b = 0;
stack<int> st;
void dfs(int x, int par = -1) {
  for (auto it : gr[x]) {
    if (it == par) continue;
    depth[it] = depth[x] + 1;
    dfs(it, x);
  }
}
int dfs2(int x, int par = -1) {
  st.push(x);
  if (x == b) return 1;
  for (auto it : gr[x]) {
    if (it == par) continue;
    int val = dfs2(it, x);
    if (val == 1) return 1;
  }
  st.pop();
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  int root = -1;
  for (int i = 0; i < n; i++) {
    if (gr[i].size() > 1) root = i;
  }
  depth[root] = 0;
  dfs(root);
  int mx = 0;
  for (int i = 0; i < n; i++) {
    if (depth[i] > mx) {
      mx = depth[i];
      a = i;
    }
  }
  depth[a] = 0;
  dfs(a);
  mx = 0;
  for (int i = 0; i < n; i++) {
    if (depth[i] > mx) {
      mx = depth[i];
      b = i;
    }
  }
  dfs2(a);
  if ((int)st.size() == n) {
    cout << n - 1 << "\n";
    int c;
    for (int i = 0; i < n; i++) {
      if (i != a && i != b) {
        c = i;
        break;
      }
    }
    cout << a + 1 << " " << b + 1 << " " << c + 1 << "\n";
    return 0;
  }
  ans = (int)st.size() - 1;
  queue<int> Q;
  int vis[n + 1];
  memset(vis, 0, sizeof(vis));
  vis[st.top()] = 1;
  st.pop();
  while (st.size() != 1) {
    int top = st.top();
    st.pop();
    vis[top] = 1;
    Q.push(top);
  }
  vis[st.top()] = 1;
  st.pop();
  while (!Q.empty()) {
    int front = Q.front();
    Q.pop();
    for (auto it : gr[front]) {
      if (vis[it] != 0) continue;
      vis[it] = vis[front] + 1;
      Q.push(it);
    }
  }
  int c;
  mx = 0;
  for (int i = 0; i < n; i++) {
    if (i == a || i == b) continue;
    if (vis[i] > mx) {
      mx = vis[i];
      c = i;
    }
  }
  cout << ans + mx - 1 << "\n";
  cout << a + 1 << " " << b + 1 << " " << c + 1 << "\n";
  return 0;
}