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;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
inline void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int N = 200050;
int n;
int To[N << 1], Ne[N << 1], He[N], deg[N], _k;
inline void add(int x, int y) {
  ++deg[x], ++deg[y];
  To[++_k] = y, Ne[_k] = He[x], He[x] = _k;
}
int fa[N], dpt[N];
int mx1[N], Fr1[N], mx2[N], Fr2[N], mx3[N], Fr3[N];
inline void dfs1(int x) {
  mx1[x] = mx2[x] = mx3[x] = 0;
  for (int p = He[x], y; p; p = Ne[p])
    if ((y = To[p]) ^ fa[x]) {
      fa[y] = x;
      dpt[y] = dpt[x] + 1;
      dfs1(y);
      int z = mx1[y];
      if (dpt[z] > dpt[mx1[x]])
        Fr3[x] = Fr2[x], mx3[x] = mx2[x], Fr2[x] = Fr1[x], mx2[x] = mx1[x],
        Fr1[x] = y, mx1[x] = z;
      else if (dpt[z] > dpt[mx2[x]])
        Fr3[x] = Fr2[x], mx3[x] = mx2[x], Fr2[x] = y, mx2[x] = z;
      else if (dpt[z] > dpt[mx3[x]])
        Fr3[x] = y, mx3[x] = z;
    }
  if (deg[x] == 2) mx1[x] = x, mx2[x] = mx3[x] = 0;
}
int ans, ax, ay, az;
inline void Upans(int Ans, int x, int y, int z) {
  if (Ans > ans) ans = Ans, ax = x, ay = y, az = z;
}
int f[N], disf[N];
inline void dfs2(int x) {
  if (mx1[x] && mx2[x] && f[x])
    Upans(disf[x] + dpt[mx1[x]] + dpt[mx2[x]] - 2 * dpt[x], f[x], mx1[x],
          mx2[x]);
  if (mx1[x] && f[x] && x != mx1[x] && x != f[x]) {
    Upans(disf[x] + dpt[mx1[x]] - dpt[x], f[x], x, mx1[x]);
  }
  if (deg[x] > 2) {
    for (int p = He[x], y; p; p = Ne[p])
      if ((y = To[p]) ^ fa[x]) {
        if (disf[x] + 1 > disf[y]) disf[y] = disf[x] + 1, f[y] = f[x];
        if (Fr1[x] == y) {
          if (Fr2[x]) {
            int d = 2 + (dpt[mx2[x]] - dpt[Fr2[x]]);
            if (d > disf[y]) disf[y] = d, f[y] = mx2[x];
          }
        } else {
          int d = 2 + (dpt[mx1[x]] - dpt[Fr1[x]]);
          if (d > disf[y]) disf[y] = d, f[y] = mx1[x];
        }
      }
    for (int p = He[x], y; p; p = Ne[p])
      if ((y = To[p]) ^ fa[x]) dfs2(y);
  }
}
int main() {
  int i, x, y, rt;
  read(n);
  ans = -1;
  for (i = 1; i < n; ++i) read(x), read(y), add(x, y), add(y, x);
  for (i = 1; i <= n; ++i)
    if (deg[i] > 2) {
      rt = i;
      break;
    }
  dfs1(rt);
  for (i = 1; i <= n; ++i)
    if (mx1[i] && mx2[i] && i != mx1[i] && i != mx2[i]) {
      Upans(dpt[mx1[i]] + dpt[mx2[i]] - 2 * dpt[i], i, mx1[i], mx2[i]);
    }
  for (i = 1; i <= n; ++i)
    if (mx1[i] && mx2[i] && mx3[i])
      Upans(dpt[mx1[i]] + dpt[mx2[i]] + dpt[mx3[i]] - 3 * dpt[i], mx1[i],
            mx2[i], mx3[i]);
  disf[rt] = -1000;
  dfs2(rt);
  cout << ans << endl << ax << ' ' << ay << ' ' << az << endl;
  return 0;
}