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;
int main() {
  int n;
  cin >> n;
  vector<int> dp1(n + 1, 1e9);
  vector<int> dp2(n + 1, 1e9);
  vector<int> dp3(n + 1, 1e9);
  vector<vector<int>> v(n + 1);
  for (int i = 0; i < (int)(n - 1); i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  queue<int> que;
  que.push(1);
  dp1[1] = 0;
  pair<int, int> hasi = pair<int, int>(0, 1);
  while (!que.empty()) {
    int a = que.front();
    que.pop();
    for (auto i : v[a]) {
      if (dp1[i] > dp1[a] + 1) {
        dp1[i] = dp1[a] + 1;
        hasi = max(hasi, pair<int, int>(dp1[i], i));
        que.push(i);
      }
    }
  }
  int hasi_id = hasi.second;
  int value = 0;
  vector<int> ans;
  ans.push_back(hasi_id);
  que.push(hasi_id);
  dp2[hasi_id] = 0;
  hasi = pair<int, int>(0, hasi_id);
  while (!que.empty()) {
    int a = que.front();
    que.pop();
    for (auto i : v[a]) {
      if (dp2[i] > dp2[a] + 1) {
        dp2[i] = dp2[a] + 1;
        hasi = max(hasi, pair<int, int>(dp2[i], i));
        que.push(i);
      }
    }
  }
  hasi_id = hasi.second;
  value += (hasi.first);
  ans.push_back(hasi_id);
  hasi = pair<int, int>(0, hasi_id);
  int tmp = hasi_id;
  while (dp2[tmp] > 0) {
    dp3[tmp] = 0;
    que.push(tmp);
    for (auto i : v[tmp]) {
      if (dp2[i] == dp2[tmp] - 1) {
        tmp = i;
        break;
      }
    }
  }
  dp3[tmp] = 0;
  que.push(tmp);
  while (!que.empty()) {
    int a = que.front();
    que.pop();
    for (auto i : v[a]) {
      if (dp3[i] > dp3[a] + 1) {
        dp3[i] = dp3[a] + 1;
        hasi = max(hasi, pair<int, int>(dp3[i], i));
        que.push(i);
      }
    }
  }
  value += hasi.first;
  ans.push_back(hasi.second);
  cout << value << endl;
  if (ans[2] == ans[1] || ans[2] == ans[0]) {
    for (int i = 1; i < n + 1; i++) {
      if (i != ans[1] && i != ans[0]) {
        ans[2] = i;
        break;
      }
    }
  }
  cout << ans[0] << ' ' << ans[1] << ' ' << ans[2] << endl;
  return 0;
}