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 modularExponentiation(long long int x, unsigned long long int y,
                                    unsigned long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, a, b;
  cin >> n;
  vector<long long int> v[n + 1];
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  vector<long long int> vi(n + 1, 0), le(n + 1, 0), parent[n + 1], ans;
  long long int src = 1, max_le = 0, ele, nodes;
  queue<long long int> q;
  vi[src] = 1;
  q.push(src);
  while (!q.empty()) {
    src = q.front();
    q.pop();
    for (auto e : v[src]) {
      if (!vi[e]) {
        le[e] = le[src] + 1;
        if (le[e] > max_le) {
          max_le = le[e];
          ele = e;
        }
        q.push(e);
      }
      vi[e] = 1;
    }
  }
  fill(le.begin(), le.end(), 0);
  fill(vi.begin(), vi.end(), 0);
  ans.push_back(ele);
  src = ele;
  max_le = 0;
  vi[src] = 1;
  q.push(src);
  parent[src].push_back(-1);
  while (!q.empty()) {
    src = q.front();
    q.pop();
    for (auto e : v[src]) {
      if (!vi[e]) {
        le[e] = le[src] + 1;
        q.push(e);
        if (le[e] > max_le) {
          max_le = le[e];
          ele = e;
        }
        parent[e].push_back(src);
      }
      vi[e] = 1;
    }
  }
  nodes = max_le;
  ans.push_back(ele);
  fill(le.begin(), le.end(), 0);
  fill(vi.begin(), vi.end(), 0);
  src = ele;
  vi[src] = 1;
  while (parent[src][0] != -1) {
    src = parent[src][0];
    q.push(src);
    vi[src] = 1;
  }
  vi[src] = 1;
  max_le = 0;
  ele = -1;
  while (!q.empty()) {
    src = q.front();
    q.pop();
    for (auto e : v[src]) {
      if (!vi[e]) {
        le[e] = le[src] + 1;
        q.push(e);
        if (le[e] > max_le) {
          max_le = le[e];
          ele = e;
        }
        parent[e].push_back(src);
      }
      vi[e] = 1;
    }
  }
  nodes += max_le;
  if (ele != -1)
    ans.push_back(ele);
  else {
    for (int i = 1; i < 4; i++) {
      if (i != ans[0] && i != ans[1]) {
        ans.push_back(i);
        break;
      }
    }
  }
  cout << nodes << endl;
  for (auto e : ans) cout << e << " ";
  cout << endl;
}