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("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
long long max3(long long x, long long y, long long z) {
  return max(max(x, y), z);
}
long long min3(long long x, long long y, long long z) {
  return min(min(x, y), z);
}
const long long N = 1e5 + 10, M = 2e5 + 10, M2 = 1e6 + 10, mod = 1e9 + 7,
                inf = 1e17 + 10;
const long long INF = 1e9 + 7;
void add(long long& a, long long b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}
long long X[] = {0, 1, 0, -1};
long long Y[] = {-1, 0, 1, 0};
long long power(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = ((x % mod) * (x % mod)) % mod;
    n = n / 2;
  }
  return result;
}
long long n;
vector<long long> adj[M];
long long d[M], p[M];
vector<long long> ds(M, -1);
void dfs(long long v, long long par, long long depth) {
  d[v] = depth;
  p[v] = par;
  for (auto u : adj[v]) {
    if (u != par) {
      dfs(u, v, depth + 1);
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, -1, 0);
  long long a = -1, b = -1, c = -1;
  long long maxi = 0;
  for (long long i = 1; i <= n; i++) {
    if (d[i] > maxi) {
      maxi = d[i];
      a = i;
    }
  }
  dfs(a, -1, 0);
  maxi = 0;
  for (long long i = 1; i <= n; i++) {
    if (d[i] > maxi) {
      maxi = d[i];
      b = i;
    }
  }
  vector<long long> dia;
  long long cur = b;
  dia.push_back(b);
  dia.push_back(a);
  while (1) {
    cur = p[cur];
    if (cur == a) break;
    dia.push_back(cur);
  }
  if (dia.size() == n) {
    cout << n - 1 << "\n";
    cout << a << " " << b << " " << dia.back() << "\n";
    return 0;
  }
  queue<long long> q;
  for (auto z : dia) {
    q.push(z);
    ds[z] = 0;
  }
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (auto u : adj[v]) {
      if (ds[u] == -1) {
        ds[u] = ds[v] + 1;
        q.push(u);
      }
    }
  }
  maxi = 0;
  for (long long i = 1; i <= n; i++) {
    if (ds[i] > maxi) {
      maxi = ds[i];
      c = i;
    }
  }
  cout << dia.size() - 1 + ds[c] << "\n";
  cout << a << " " << b << " " << c << "\n";
  return 0;
}