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;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
template <typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template <typename T>
using Edges = vector<edge<T>>;
template <typename T>
using WeightedGraph = vector<Edges<T>>;
using UnweightedGraph = vector<vector<int>>;
template <typename T>
using Matrix = vector<vector<T>>;
template <typename T>
pair<T, int> dfs(const WeightedGraph<T> &G, int v, int par) {
  pair<T, int> res = {0, v};
  for (auto &e : G[v]) {
    if (e.to == par) continue;
    auto dist = dfs(G, e.to, v);
    dist.first += e.cost;
    res = max(res, dist);
  }
  return res;
}
template <typename T>
pair<T, pair<int, int>> tree_diameter(const WeightedGraph<T> &G) {
  auto p = dfs(G, 0, -1);
  auto q = dfs(G, p.second, -1);
  return {q.first, {q.second, p.second}};
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int N;
  cin >> N;
  WeightedGraph<int> G(N);
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    G[a].emplace_back(b, 1);
    G[b].emplace_back(a, 1);
  }
  auto p = tree_diameter(G);
  int a = p.second.first, b = p.second.second, edge_size = p.first, c = 0,
      mx = 0;
  if (edge_size == N - 1) {
    cout << edge_size << "\n";
    for (int i = 0; i < N; i++) {
      if (i != a && i != b) c = i;
    }
    cout << a + 1 << " " << b + 1 << " " << c + 1 << "\n";
    return 0;
  }
  vector<int> dist1(N, inf), dist2(N, inf);
  dist1[a] = 0;
  stack<int> st;
  st.push(a);
  while (!st.empty()) {
    int v = st.top();
    st.pop();
    for (auto &u : G[v]) {
      if (u == v || dist1[u] != inf) continue;
      dist1[u] = min(dist1[u], dist1[v] + 1);
      st.push(u);
    }
  }
  dist2[b] = 0;
  st.push(b);
  while (!st.empty()) {
    int v = st.top();
    st.pop();
    for (auto &u : G[v]) {
      if (u == v || dist2[u] != inf) continue;
      dist2[u] = min(dist2[u], dist2[v] + 1);
      st.push(u);
    }
  }
  for (int i = 0; i < N; i++) {
    if (mx < (dist1[i] + dist2[i] - edge_size) / 2 && i != b && i != a) {
      c = i, mx = (dist1[i] + dist2[i] - edge_size) / 2;
    }
  }
  cout << edge_size + (dist1[c] + dist2[c] - edge_size) / 2 << "\n";
  cout << a + 1 << " " << b + 1 << " " << c + 1 << "\n";
}