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 gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int expo(long long int a, long long int b) {
  long long int r = 1;
  a = a % 1000000007;
  while (b) {
    if (b % 2) r = (r * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return r;
}
vector<int> adj[200001];
vector<int> dp1(200001);
vector<int> ind1(200001);
vector<int> ind2(200001);
vector<int> ind3(200001);
vector<int> dp2(200001);
vector<int> dp3(200001);
vector<int> up(200001);
vector<int> u_ind(200001);
void dfs(int i, int par) {
  int mx1 = 0, mx2 = 0, mx3 = 0;
  ind1[i] = ind2[i] = ind3[i] = i;
  for (auto x : adj[i]) {
    if (x == par) continue;
    dfs(x, i);
    if (mx1 < (1 + dp1[x])) {
      mx3 = mx2;
      ind3[i] = ind2[i];
      mx2 = mx1;
      ind2[i] = ind1[i];
      mx1 = 1 + dp1[x];
      ind1[i] = ind1[x];
    } else if (mx2 < (1 + dp1[x])) {
      mx3 = mx2;
      ind3[i] = ind2[i];
      mx2 = 1 + dp1[x];
      ind2[i] = ind1[x];
    } else if (mx3 < (1 + dp1[x])) {
      mx3 = 1 + dp1[x];
      ind3[i] = ind1[x];
    }
  }
  dp1[i] = mx1;
  dp2[i] = mx2;
  dp3[i] = mx3;
}
void dfs2(int i, int par) {
  multiset<pair<int, int> > s;
  s.insert(make_pair(up[i], u_ind[i]));
  for (auto x : adj[i]) {
    if (x != par) s.insert(make_pair(1 + dp1[x], ind1[x]));
  }
  for (auto x : adj[i]) {
    if (x == par) continue;
    s.erase(s.find(make_pair(1 + dp1[x], ind1[x])));
    pair<int, int> z = (*s.rbegin());
    up[x] = 1 + z.first;
    u_ind[x] = z.second;
    dfs2(x, i);
    s.insert(make_pair(1 + dp1[x], ind1[x]));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i < n; i++) {
      int x, y;
      cin >> x >> y;
      adj[x].push_back(y);
      adj[y].push_back(x);
    }
    dfs(1, 0);
    u_ind[1] = 1;
    dfs2(1, 0);
    int ans = 0;
    int x1 = 0, x2 = 0, x3 = 0;
    for (int i = 1; i <= n; i++) {
      if ((up[i] + dp1[i] + dp2[i]) > ans) {
        ans = up[i] + dp1[i] + dp2[i];
        x1 = ind1[i], x2 = ind2[i], x3 = u_ind[i];
      }
      if ((dp3[i] + dp1[i] + dp2[i]) > ans) {
        ans = dp3[i] + dp1[i] + dp2[i];
        x1 = ind1[i], x2 = ind2[i], x3 = ind3[i];
      }
    }
    cout << ans << endl;
    set<int> s;
    s.insert(x1);
    s.insert(x2);
    s.insert(x3);
    if (s.size() < 3) {
      for (int i = 1; i <= n; i++) {
        if (s.find(i) == s.end()) {
          s.insert(i);
          break;
        }
      }
    }
    for (auto x : s) {
      cout << x << " ";
    }
    cout << endl;
  }
  return 0;
}