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 power(long long x, long long y) {
  long long res = 1LL;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res % 1000000007;
}
long long inv(long long n) { return power(n, 1000000007 - 2) % 1000000007; }
long long isprime(long long n) {
  if (n < 2) return 0;
  long long i;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
vector<long long> a[200005];
long long n, d[200005], mx, v1, dia, v2, p[200005], onpath[200005], v3;
void dfs1(long long v, long long par) {
  d[v] = 1 + d[par];
  for (auto x : a[v]) {
    if (x == par) continue;
    dfs1(x, v);
  }
}
void dfs2(long long v, long long par) {
  p[v] = par;
  d[v] = 1 + d[par];
  if (d[v] > dia) {
    dia = d[v];
    v2 = v;
  }
  for (auto x : a[v]) {
    if (x == par) continue;
    dfs2(x, v);
  }
}
void dfs3(long long v, long long par, long long dep) {
  if (dep > mx) {
    mx = dep;
    v3 = v;
  }
  for (auto x : a[v]) {
    if (x == par) continue;
    dfs3(x, v, dep + 1);
  }
}
void solve() {
  cin >> n;
  long long i, x, y;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  dfs1(1, 0);
  for (i = 1; i <= n; i++)
    if (d[i] > mx) {
      mx = d[i];
      v1 = i;
    }
  d[0] = -1;
  dfs2(v1, 0);
  long long c = 1;
  long long tmp = v2;
  while (p[tmp]) {
    onpath[tmp] = 1;
    c++;
    tmp = p[tmp];
  }
  onpath[tmp] = 1;
  if (c == n) {
    cout << dia << "\n";
    cout << v1 << " " << v2 << " ";
    for (i = 1; i <= n; i++)
      if (i != v1 && i != v2) {
        cout << i << "\n";
        break;
      }
    return;
  }
  mx = 0;
  tmp = v2;
  while (tmp) {
    for (auto x : a[tmp]) {
      if (onpath[x] == 0) {
        dfs3(x, tmp, 1);
      }
    }
    tmp = p[tmp];
  }
  cout << dia + mx << "\n" << v1 << " " << v2 << " " << v3 << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  long long tc = 0;
  while (t--) {
    tc++;
    solve();
  }
}