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 pint = pair<int, int>;
struct fast_ios {
  fast_ios() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T>
bool mmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
using Edges = vector<vector<int>>;
vector<int> tree_distance(int N, int r, Edges &e) {
  vector<int> res(N);
  queue<pint> q;
  q.push(pint(r, -1));
  while (!q.empty()) {
    pint pa = q.front();
    q.pop();
    if (pa.second >= 0) res[pa.first] = res[pa.second] + 1;
    for (auto nx : e[pa.first])
      if (nx != pa.second) q.push(pint(nx, pa.first));
  }
  return res;
}
pint tree_diameter(int N, int r, Edges &e) {
  vector<int> d = tree_distance(N, r, e);
  int s = max_element(d.begin(), d.end()) - d.begin();
  d = tree_distance(N, s, e);
  int t = max_element(d.begin(), d.end()) - d.begin();
  return make_pair(s, t);
}
int main() {
  int N;
  cin >> N;
  Edges e(N);
  for (int i = (0), i_end_ = (N - 1); i < i_end_; i++) {
    int s, t;
    cin >> s >> t;
    s--, t--;
    e[s].push_back(t);
    e[t].push_back(s);
  }
  int s, t;
  tie(s, t) = tree_diameter(N, 0, e);
  vector<int> ds = tree_distance(N, s, e);
  vector<int> dt = tree_distance(N, t, e);
  queue<int> q;
  vector<int> D(N, 1e9);
  for (int i = (0), i_end_ = (N); i < i_end_; i++)
    if (ds[i] + dt[i] == dt[s]) q.push(i), D[i] = 0;
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    for (auto nxt : e[now])
      if (D[nxt] == 1e9) D[nxt] = D[now] + 1, q.push(nxt);
  }
  int u = -1;
  int ret = -1;
  for (int i = (0), i_end_ = (N); i < i_end_; i++)
    if (i != s and i != t) {
      if (mmax(ret, ds[t] + D[i])) u = i;
    }
  cout << ret << "\n" << s + 1 << " " << t + 1 << " " << u + 1 << endl;
}