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;
const long long N = 4e5 + 100;
const long long M = 10;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
const long long P = 1336;
const long double eps = 0.000000001;
const long long inf = 1e9 + 7;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
long long tin[N], tout[N], h[N], up[N][25];
vector<long long> d, g[N];
queue<long long> q;
long long timer;
void calc(long long v, long long p, long long high) {
  tin[v] = ++timer;
  h[v] = high;
  up[v][0] = p;
  for (long long i = 1; i < 25; ++i) {
    up[v][i] = up[up[v][i - 1]][i - 1];
  }
  for (auto to : g[v]) {
    if (to != p) {
      calc(to, v, high + 1);
    }
  }
  tout[v] = ++timer;
}
bool upper(long long a, long long b) {
  return (tin[a] <= tin[b] && tout[a] >= tout[b]);
}
long long lca(long long a, long long b) {
  if (upper(a, b)) return a;
  if (upper(b, a)) return b;
  for (long long i = 24; i >= 0; --i) {
    if (!upper(up[a][i], b)) a = up[a][i];
  }
  return up[a][0];
}
void bfs() {
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (auto to : g[v]) {
      if (d[to] == -1) {
        d[to] = d[v] + 1;
        q.push(to);
      }
    }
  }
}
void dfs(long long v, long long p, long long h) {
  d[v] = h;
  for (auto to : g[v]) {
    if (to != p) {
      dfs(to, v, h + 1);
    }
  }
}
bool f = 0;
vector<long long> path;
void way(long long v, long long p, long long u) {
  path.push_back(v);
  if (v == u) {
    f = 1;
    return;
  }
  for (auto to : g[v]) {
    if (to != p) {
      way(to, v, u);
      if (f == 1) return;
    }
  }
  path.pop_back();
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    long long x, y;
    cin >> x >> y;
    --x;
    --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  calc(0, 0, 0);
  d.assign(n, 0);
  dfs(0, 0, 0);
  long long cur = 0, v = 0;
  for (long long i = 0; i < n; ++i) {
    if (d[i] > cur) {
      cur = d[i];
      v = i;
    }
  }
  d.assign(n, 0);
  dfs(v, v, 0);
  long long u = 0;
  cur = 0;
  for (long long i = 0; i < n; ++i) {
    if (d[i] > cur) {
      cur = d[i];
      u = i;
    }
  }
  way(u, u, v);
  d.assign(n, -1);
  for (auto to : path) {
    d[to] = 0;
    q.push(to);
  }
  bfs();
  long long w = 0;
  cur = 0;
  for (long long i = 0; i < n; ++i) {
    if (d[i] >= cur && i != u && i != v) {
      cur = d[i];
      w = i;
    }
  }
  cout << ((h[u] + h[w] - 2 * h[lca(u, w)]) + (h[w] + h[v] - 2 * h[lca(w, v)]) +
           (h[u] + h[v] - 2 * h[lca(u, v)])) /
              2
       << '\n';
  cout << u + 1 << " " << v + 1 << " " << w + 1;
}