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;
vector<int> g[200005], gx[200005];
int depth[200005];
int vis[200005];
int z[200005];
int flag = 0;
void dfs(int x, int fa) {
  depth[x] = depth[fa] + 1;
  vis[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int t = g[x][i];
    if (vis[t]) continue;
    dfs(t, x);
  }
}
void dfsx(int x, int end) {
  if (x == end) {
    flag = 1;
    z[x] = 1;
    return;
  }
  vis[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int t = g[x][i];
    if (vis[t]) continue;
    dfsx(t, end);
    if (flag) {
      z[x] = 1;
      break;
    }
  }
}
void dfsz(int x, int fa) {
  depth[x] = depth[fa] + 1;
  vis[x] = 1;
  for (int i = 0; i < gx[x].size(); i++) {
    int t = gx[x][i];
    if (vis[t]) continue;
    dfsz(t, x);
  }
}
int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0);
  int maxn = 0;
  int index;
  for (int i = 1; i <= n; i++) {
    if (maxn < depth[i]) {
      maxn = depth[i];
      index = i;
    }
  }
  memset(depth, 0, sizeof(depth));
  memset(vis, 0, sizeof(vis));
  dfs(index, 0);
  int ans1 = index;
  maxn = 0;
  int index2 = 0;
  for (int i = 1; i <= n; i++) {
    if (maxn < depth[i]) {
      maxn = depth[i];
      index2 = i;
    }
  }
  int ans2 = index2;
  ans += depth[index2] - 1;
  memset(vis, 0, sizeof(vis));
  dfsx(ans1, ans2);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < g[i].size(); j++) {
      if (z[i] == 1) {
        if (!z[g[i][j]]) gx[0].push_back(g[i][j]);
      } else {
        if (z[g[i][j]])
          gx[i].push_back(0);
        else
          gx[i].push_back(g[i][j]);
      }
    }
  }
  memset(depth, 0, sizeof(depth));
  memset(vis, 0, sizeof(vis));
  dfsz(0, 0);
  maxn = 0;
  int index3 = -1;
  for (int i = 1; i <= n; i++) {
    if (maxn < depth[i]) {
      maxn = depth[i];
      index3 = i;
    }
  }
  int ans3;
  if (index3 == -1) {
    for (int i = 1; i <= n; i++) {
      if (i != ans1 && i != ans2) {
        ans3 = i;
        break;
      }
    }
  } else {
    ans3 = index3;
    ans += depth[index3] - 1;
  }
  cout << ans << '\n';
  cout << ans1 << ' ' << ans2 << ' ' << ans3 << '\n';
  return 0;
}