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>
#pragma GCC optimize("Ofast")
using namespace std;
void fio() {}
void pti() {
  double timeuse = clock() * 1000.0 / CLOCKS_PER_SEC;
  cerr << "Timeuse " << timeuse << "ms" << endl;
}
void end() {
  pti();
  exit(0);
}
namespace io {
const int SIZ = 55;
int que[SIZ], op, qr;
char ch;
template <class I>
inline void gi(I &w) {
  ch = getchar(), op = 1, w = 0;
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    w = w * 10 + ch - '0';
    ch = getchar();
  }
  w *= op;
}
template <class I>
inline void print(I w) {
  qr = 0;
  if (!w) putchar('0');
  if (w < 0) putchar('-'), w = -w;
  while (w) que[++qr] = w % 10 + '0', w /= 10;
  while (qr) putchar(que[qr--]);
}
}  // namespace io
using io::gi;
using io::print;
const int N = 2e5 + 5;
struct EDGE {
  int to, nxt;
};
int n, cnt, maxd, rt1, rt2, rt3, ans;
int head[N], rev[N], anc[N];
EDGE e[N * 2];
void add(int x, int y) {
  e[++cnt].to = y;
  e[cnt].nxt = head[x];
  head[x] = cnt;
}
void link(int x, int y) { add(x, y), add(y, x); }
void dfs1(int x, int fa, int d) {
  if (d > maxd) maxd = d, rt1 = x;
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs1(v, x, d + 1);
  }
}
void dfs2(int x, int fa, int d) {
  if (d > maxd) maxd = d, rt2 = x, ans = d;
  anc[x] = fa;
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs2(v, x, d + 1);
  }
}
void calc(int x, int d) {
  if (d > maxd) maxd = d, rt3 = x;
  for (int i = head[x]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == anc[x] || v == rev[x]) continue;
    calc(v, d + 1);
  }
}
int main() {
  fio();
  gi(n);
  for (int i = 1, x, y; i <= n - 1; ++i) gi(x), gi(y), link(x, y);
  dfs1(1, 0, 0), maxd = 0;
  dfs2(rt1, 0, 0), maxd = 0;
  int x = rt2, res = 0;
  while (x) {
    rev[anc[x]] = x;
    calc(x, 0);
    x = anc[x];
  }
  print(ans + maxd), putchar(10);
  print(rt1), putchar(' '), print(rt2), putchar(' ');
  if (!rt3)
    for (int i = 1; i <= n; ++i)
      if (i != rt1 && i != rt2) rt3 = i;
  print(rt3);
  end();
}