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;
long long int n;
vector<long long> parent;
vector<vector<long long int> > adj;
pair<long long int, long long int> dfs(long long int v, long long int papa = -1,
                                       long long int dist = 0) {
  parent[v] = papa;
  pair<long long int, long long int> res = make_pair(dist, v);
  for (auto it : adj[v]) {
    if (it == papa) {
      continue;
    }
    res = max(res, dfs(it, v, dist + 1));
  }
  return res;
}
void solve() {
  cin >> n;
  parent = vector<long long int>(n);
  adj = vector<vector<long long int> >(n);
  for (long long int i = 1; i <= n - 1; i++) {
    long long int a, b;
    cin >> a;
    cin >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  pair<long long int, long long int> A = dfs(0);
  pair<long long int, long long int> B = dfs(A.second);
  vector<long long> kd;
  long long int cur = B.second;
  while (cur != A.second) {
    kd.push_back(cur);
    cur = parent[cur];
  }
  kd.push_back(A.second);
  if ((long long int)kd.size() == n) {
    cout << n - 1;
    cout << '\n';
    cout << kd[0] + 1;
    cout << " ";
    cout << kd[1] + 1;
    cout << " ";
    cout << kd.back() + 1;
    cout << '\n';
  } else {
    queue<long long int> q;
    vector<long long> away(n, -1);
    for (auto it : kd) {
      away[it] = 0;
      q.push(it);
    }
    while (!q.empty()) {
      long long int pm = q.front();
      q.pop();
      for (auto it : adj[pm]) {
        if (away[it] == -1) {
          away[it] = away[pm] + 1;
          q.push(it);
        }
      }
    }
    pair<long long int, long long int> maxi = make_pair(away[0], 0);
    for (long long int i = 1; i <= n - 1; i++) {
      maxi = max(maxi, make_pair(away[i], i));
    }
    cout << (long long int)kd.size() - 1 + maxi.first;
    cout << '\n';
    cout << kd[0] + 1;
    cout << " ";
    cout << maxi.second + 1;
    cout << " ";
    cout << kd.back() + 1;
    cout << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}