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;
const long long int INF = 3000000000000000000;
vector<long long int> adj[5000005];
bool vis[5000005], vis1[5000005], vis2[5000005];
map<long long int, long long int> dist;
map<long long int, long long int> dist1;
map<long long int, long long int> dist2;
void dfs(long long int n, long long int count) {
  vis[n] = true;
  for (auto x : adj[n]) {
    if (!vis[x]) {
      dist[x] = max(dist[x], count + 1);
      dfs(x, count + 1);
    }
  }
}
void dfs1(long long int n, long long int count) {
  vis1[n] = true;
  for (auto x : adj[n]) {
    if (!vis1[x]) {
      dist1[x] = count + 1;
      dfs1(x, count + 1);
    }
  }
}
void dfs2(long long int n, long long int count) {
  vis2[n] = true;
  for (auto x : adj[n]) {
    if (!vis2[x]) {
      dist2[x] = count + 1;
      dfs2(x, count + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1, xp = 1;
  while (t--) {
    long long int i = 0, h, j = 0, x = 0, y = 0, n, m, k = 0, r = 0, l = 0,
                  o = 0, cnt1 = INT_MAX, cnt2 = 0, cnt3 = INT_MIN, cnt4 = 0,
                  min1 = INT_MIN;
    cin >> n;
    for (i = 0; i < n - 1; i++) {
      cin >> x >> y;
      x--;
      y--;
      adj[x].push_back(y);
      adj[y].push_back(x);
    }
    dist[0] = 0;
    dfs(0, 0);
    long long int nd1 = -1, nd2 = -1, nd3 = -1;
    for (auto x : dist) {
      if (cnt2 < x.second) {
        nd1 = x.first;
        cnt2 = x.second;
      }
    }
    dfs1(nd1, 0);
    for (auto x : dist1) {
      if (cnt4 < x.second) {
        cnt4 = x.second;
        nd2 = x.first;
      }
    }
    dfs2(nd2, 0);
    cnt2 = dist2[nd1];
    set<long long int> s;
    for (i = 0; i < n; i++) {
      if (dist1[i] + dist2[i] == cnt2) {
        s.insert(i);
      }
    }
    memset(vis, 0, sizeof(vis));
    for (auto x : s) {
      if (x != nd1 && x != nd2) {
        nd3 = x;
      }
      vis[x] = true;
    }
    if (cnt2 == n - 1) {
      cout << n - 1 << endl;
      cout << nd2 + 1 << " " << nd1 + 1 << " " << nd3 + 1 << endl;
    } else {
      dist.clear();
      for (auto x : s) {
        dfs(x, 0);
      }
      for (auto x : dist) {
        if (o < x.second) {
          o = x.second;
          nd3 = x.first;
        }
      }
      cout << cnt2 + o << endl;
      cout << nd3 + 1 << " " << nd1 + 1 << " " << nd2 + 1 << endl;
    }
  }
}