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 mod = 1000000007;
long long int binpow(long long int z, long long int n) {
  if (n == 0) return 1;
  if (n % 2 == 1)
    return (binpow(z, n - 1) * z) % mod;
  else
    return (binpow(z, n / 2) * binpow(z, n / 2)) % mod;
}
bool isvalid(long long int x, long long int y,
             vector<vector<long long int> > &a) {
  long long int n = a.size();
  long long int m = a[0].size();
  if (x < 0 || x >= n || y < 0 || y >= m)
    return 0;
  else
    return 1;
}
void multibfs(vector<vector<long long int> > &a, vector<long long int> &vis,
              queue<long long int> &v) {
  long long int x, y;
  while (!v.empty()) {
    long long int p = v.front();
    v.pop();
    for (long long int i = 0; i < (a[p].size()); i++) {
      long long int z = a[p][i];
      if (vis[z] != -1) continue;
      vis[z] = vis[p] + 1;
      v.push(z);
    }
  }
}
void dfslev(long long int x, long long int par,
            vector<vector<long long int> > &a, vector<long long int> &lev) {
  for (long long int i = 0; i < (a[x].size()); i++) {
    long long int z = a[x][i];
    if (z == par) continue;
    lev[z] = lev[x] + 1;
    dfslev(z, x, a, lev);
  }
}
long long int path(long long int x, long long int par, long long int tar,
                   vector<vector<long long int> > &a,
                   vector<long long int> &vis, queue<long long int> &v) {
  if (x == tar) {
    vis[x] = 0;
    v.push(x);
    return 1;
  }
  for (long long int i = 0; i < (a[x].size()); i++) {
    long long int z = a[x][i];
    if (z == par) continue;
    long long int val = path(z, x, tar, a, vis, v);
    if (val == 1) {
      vis[x] = 0;
      v.push(x);
      return 1;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    vector<vector<long long int> > a(n);
    long long int x, y, z, w, u, res = 0;
    for (long long int i = 0; i < ((n - 1)); i++) {
      cin >> x >> y;
      a[x - 1].push_back(y - 1);
      a[y - 1].push_back(x - 1);
    }
    vector<long long int> lev(n, 0);
    vector<long long int> vis(n, -1);
    dfslev(0, 0, a, lev);
    long long int maxi = 0;
    for (long long int i = 0; i < (n); i++) {
      if (lev[i] > maxi) {
        maxi = lev[i];
        z = i;
      }
    }
    lev = vector<long long int>(n, 0);
    dfslev(z, z, a, lev);
    maxi = 0;
    for (long long int i = 0; i < (n); i++) {
      if (lev[i] > maxi) {
        maxi = lev[i];
        w = i;
      }
    }
    res += lev[w];
    queue<long long int> v;
    long long int none = path(z, z, w, a, vis, v);
    multibfs(a, vis, v);
    maxi = 0;
    for (long long int i = 0; i < (n); i++) {
      if (vis[i] >= maxi && i != w && i != z) {
        maxi = vis[i];
        u = i;
      }
    }
    res += vis[u];
    cout << res << "\n";
    cout << u + 1 << " " << z + 1 << " " << w + 1 << "\n";
  }
}