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 bg = 9982443530987;
vector<vector<long long int> > vec(400000), newvec(400000);
set<pair<long long int, long long int> > vec1;
set<long long int> set1;
long long int vis[400000], f[400000], f2[400000];
void dfs(long long int i, long long int k) {
  long long int j, s = 0;
  vis[i] = 1;
  f[i] = k;
  for (j = 0; j < vec[i].size(); j++) {
    if (vis[vec[i][j]] == 0) dfs(vec[i][j], k + 1);
  }
}
void dfs2(long long int i, long long int k) {
  long long int j, s = 0;
  vis[i] = 1;
  f2[i] = k;
  for (j = 0; j < vec[i].size(); j++) {
    if (vis[vec[i][j]] == 0) dfs2(vec[i][j], k + 1);
  }
}
int dfs3(long long int i, long long int b) {
  long long int j, s = 0;
  vis[i] = 1;
  for (j = 0; j < vec[i].size(); j++) {
    if (vis[vec[i][j]] == 0) {
      long long int h = dfs3(vec[i][j], b), a = min(i, vec[i][j]),
                    b = max(i, vec[i][j]);
      s += h;
      if (h == 1) {
        vec1.insert(make_pair(a, b));
        set1.insert(a);
        set1.insert(b);
      }
    }
  }
  if (i == b || s > 0)
    return 1;
  else
    return 0;
}
pair<long long int, long long int> dfs4(long long int i) {
  long long int j, s = 0;
  vis[i] = 1;
  vector<pair<long long int, long long int> > gg;
  for (j = 0; j < newvec[i].size(); j++) {
    if (vis[newvec[i][j]] == 0) gg.push_back(dfs4(newvec[i][j]));
  }
  sort(gg.begin(), gg.end());
  if (gg.size() == 0)
    return make_pair(1, i);
  else
    return make_pair(gg[gg.size() - 1].first + 1, gg[gg.size() - 1].second);
}
void boom() {
  long long int i, n, h = bg, j, m, k;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    long long int a, b;
    cin >> a >> b;
    vec[a - 1].push_back(b - 1);
    vec[b - 1].push_back(a - 1);
  }
  dfs(0, 1);
  long long int a = 0, dis1 = 0;
  for (i = 0; i < n; i++) {
    if (dis1 <= f[i]) {
      a = i;
      dis1 = f[i];
    }
  }
  for (i = 0; i < n; i++) vis[i] = 0;
  dfs2(a, 1);
  long long int b = 0, dis2 = 0;
  for (i = 0; i < n; i++) {
    if (dis2 <= f2[i] && i != a) {
      b = i;
      dis2 = f2[i];
    }
  }
  for (i = 0; i < n; i++) vis[i] = 0;
  int y = dfs3(a, b);
  for (i = 0; i < n; i++) {
    for (j = 0; j < vec[i].size(); j++) {
      long long int h1 = min(i, vec[i][j]), h2 = max(i, vec[i][j]);
      if (vec1.find(make_pair(h1, h2)) == vec1.end())
        newvec[i].push_back(vec[i][j]);
    }
  }
  set<long long int>::iterator yy = set1.begin();
  vector<pair<long long int, long long int> > final;
  for (i = 0; i < n; i++) vis[i] = 0;
  for (; yy != set1.end(); yy++) {
    pair<long long int, long long int> dd = dfs4(*yy);
    final.push_back(dd);
  }
  sort(final.begin(), final.end());
  cout << dis2 + final[final.size() - 1].first - 2 << '\n';
  for (i = final.size() - 1; i >= 0; i--)
    if (final[i].second != a && final[i].second != b) {
      cout << a + 1 << " " << b + 1 << " " << final[i].second + 1;
      break;
    }
}
int main() {
  long long int t;
  t = 1;
  while (t--) boom();
  return 0;
}