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", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC optimize(3)
using namespace std;
const long long INF = 1e17 + 7;
const long long maxn = 2e6 + 700;
const long long mod = 1e9 + 7;
const long long up = 1e13;
const double eps = 1e-9;
const double PI = acos(-1);
template <typename T>
inline void read(T &a) {
  char c = getchar();
  T x = 0, f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  a = f * x;
}
long long n, m, p;
vector<int> v[maxn];
int dp[maxn], suf[maxn], pos[maxn];
int b[maxn];
int in[maxn];
vector<pair<int, int>> g[maxn];
void dfs(int u, int fa) {
  pos[u] = u;
  for (int e : v[u]) {
    if (e == fa) continue;
    dfs(e, u);
    if (dp[u] < dp[e] + 1) {
      dp[u] = dp[e] + 1;
      pos[u] = pos[e];
    }
  }
}
int a = 0, bt = 0, c = 0;
int maxl = 0;
int res[5];
void work(int u, int fa) {
  if (u != fa) {
    if (suf[u] < suf[fa] + 1) suf[u] = suf[fa] + 1, b[u] = b[fa];
    if (g[fa][0].second != pos[u]) {
      if (suf[u] < g[fa][0].first + 2)
        suf[u] = g[fa][0].first + 2, b[u] = g[fa][0].second;
    } else if (g[fa].size() > 1) {
      if (suf[u] < g[fa][1].first + 2)
        suf[u] = g[fa][1].first + 2, b[u] = g[fa][1].second;
    }
  } else
    b[u] = u;
  for (int e : v[u]) {
    if (e == fa) continue;
    work(e, u);
  }
}
int main() {
  int mx = 0;
  read(n);
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    read(x);
    read(y);
    v[x].push_back(y);
    v[y].push_back(x);
    in[y]++;
    in[x]++;
  }
  for (int i = 1; i <= n; i++) mx = max(mx, in[i]);
  if (mx <= 2) {
    printf("%lld\n", n - 1);
    int last = 1;
    for (int i = 1; i <= n; i++)
      if (in[i] == 1) {
        printf("%d ", i);
      } else
        last = i;
    printf("%d\n", last);
  } else {
    dfs(1, 1);
    for (int i = 1; i <= n; i++) {
      for (int x : v[i]) {
        if (dp[x] < dp[i]) g[i].push_back({dp[x], pos[x]});
      }
    }
    for (int i = 1; i <= n; i++)
      sort(g[i].begin(), g[i].end(), greater<pair<int, int>>());
    work(1, 1);
    for (int i = 1; i <= n; i++) {
      for (auto &x : g[i]) x.first++;
      g[i].push_back({suf[i], b[i]});
    }
    for (int i = 1; i <= n; i++)
      sort(g[i].begin(), g[i].end(), greater<pair<int, int>>());
    for (int i = 1; i <= n; i++) {
      long long sum = 0;
      if (g[i].size() >= 3) {
        for (int k = 0; k < 3; k++) sum += g[i][k].first;
        if (maxl < sum) {
          maxl = sum;
          for (int k = 0; k < 3; k++) res[k] = g[i][k].second;
        }
      }
    }
    printf("%d\n", maxl);
    ;
    for (int i = 0; i < 3; i++) printf("%d ", res[i]);
    printf("\n");
  }
  return 0;
}