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.
#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323;
long long int mod = 1000000000 + 7;
const double pii = acos(-1.0);
const long long int INF = 1e18;
const long long int inf = 1e9;
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long powe(long long x, long long y) {
  x = x % mod, y = y % (mod - 1);
  long long ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans = (1ll * x * ans) % mod;
    }
    y >>= 1;
    x = (1ll * x * x) % mod;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b) * b); }
bool isPrime(long long int n) {
  if (n < 2) return false;
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long ncr(long long n, long long r) {
  long long res = 1;
  if (r > n) return 0;
  if (r > n - r) r = n - r;
  for (long long i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
long long add(long long a, long long b) { return ((a % mod + b % mod) % mod); }
long long sub(long long a, long long b) {
  return ((a % mod - b % mod + mod) % mod);
}
long long mul(long long a, long long b) {
  return (((a % mod) * (b % mod)) % mod);
}
long long divi(long long a, long long b) {
  return (mul(a, powe(b, mod - 2)) % mod);
}
void fun() {}
const long long int N = 2e5 + 7;
std::vector<long long int> adj[N];
bool visited[N];
long long int len, point;
set<long long int> path;
long long int parent[N];
void dfs(long long int node, long long int dist) {
  visited[node] = true;
  for (auto child : adj[node]) {
    if (!visited[child]) {
      if (len <= dist) {
        len = dist;
        point = child;
      }
      dfs(child, dist + 1);
    }
  }
}
void find_par(long long int node, long long int par = 0) {
  visited[node] = true;
  parent[node] = par;
  for (auto child : adj[node]) {
    if (!visited[child]) {
      find_par(child, node);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  fun();
  long long int tests = 1;
  while (tests--) {
    long long int n;
    cin >> n;
    for (long long int i = 1; i < n; i++) {
      long long int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    long long int a = 1, b = 1, c = 1;
    dfs(1, 0);
    a = point;
    memset(visited, false, sizeof(visited));
    len = 0;
    dfs(point, 0);
    b = point;
    memset(visited, false, sizeof(visited));
    find_par(point, point);
    point = a;
    while (point != b) {
      path.insert(point);
      point = parent[point];
    }
    path.insert(b);
    std::vector<long long int> distance(N);
    memset(visited, false, sizeof(visited));
    queue<long long int> q;
    for (long long int i : path) visited[i] = true, q.push(i);
    while (!q.empty()) {
      long long int ye = q.front();
      q.pop();
      visited[ye] = true;
      for (auto child : adj[ye]) {
        if (!visited[child]) {
          q.push(child);
          distance[child] = distance[ye] + 1;
        }
      }
    }
    long long int duri = 0;
    for (long long int i = 1; i <= n; i++) {
      if (i == a or i == b) continue;
      if (distance[i] >= duri) {
        duri = distance[i];
        c = i;
      }
    }
    memset(parent, 0, sizeof(parent));
    memset(visited, false, sizeof(visited));
    find_par(c, c);
    point = b;
    while (point != c) {
      path.insert(point);
      point = parent[point];
    }
    path.insert(c);
    point = a;
    while (point != c) {
      path.insert(point);
      point = parent[point];
    }
    path.insert(c);
    cout << (long long int)(path.size()) - 1 << '\n';
    cout << a << ' ' << b << ' ' << c << '\n';
  }
  cerr << "time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
  return 0;
}
