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;
double PI = 3.14159265358979323846;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isprime[1000000];
vector<long long> p;
void init() {
  isprime[0] = true;
  isprime[1] = true;
  for (long long i = 2; i <= 999999; i++) {
    if (isprime[i]) continue;
    p.push_back(i);
    for (long long j = 2; j * i <= 999999; j++) isprime[i * j] = true;
  }
}
pair<int, int> fill(vector<vector<pair<int, int> > > &ans, int x,
                    vector<vector<int> > &v, vector<bool> &chk) {
  chk[x] = true;
  int gg = 0;
  int point = x;
  for (int i = 0; i < v[x].size(); i++) {
    if (chk[v[x][i]]) continue;
    auto k = fill(ans, v[x][i], v, chk);
    if (k.first > gg) {
      gg = k.first;
      point = k.second;
    }
    ans[x].push_back(k);
  }
  return make_pair(gg + 1, point);
}
int st;
void fillback(vector<vector<pair<int, int> > > &ans, int x,
              vector<vector<int> > &v, vector<bool> &chk) {
  chk[x] = true;
  if (x == st) {
    for (int i = 0; i < v[x].size(); i++) {
      ans[v[x][i]].push_back(make_pair(1, x));
      fillback(ans, v[x][i], v, chk);
    }
    return;
  }
  int idx = 0;
  for (int i = 0; i < ans[x].size(); i++) {
    if (ans[x][i].first > ans[x][idx].first) idx = i;
  }
  auto t = ans[x][idx];
  int cnt = 0;
  for (int i = 0; i < v[x].size(); i++) {
    if (chk[v[x][i]]) continue;
    if (idx == cnt) {
      int idx2 = 0;
      if (idx == 0) idx2 = 1;
      for (int i = 0; i < ans[x].size(); i++) {
        if (i == idx) continue;
        if (ans[x][i].first > ans[x][idx2].first) idx2 = i;
      }
      auto t2 = ans[x][idx2];
      ans[v[x][i]].push_back(make_pair(t2.first + 1, t2.second));
      fillback(ans, v[x][i], v, chk);
    } else {
      ans[v[x][i]].push_back(make_pair(t.first + 1, t.second));
      fillback(ans, v[x][i], v, chk);
    }
    cnt++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<vector<int> > v(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  vector<vector<pair<int, int> > > ans(n + 1);
  vector<bool> chk(n + 1);
  vector<bool> chk2(n + 1);
  int start;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() == 1) {
      start = i;
      break;
    }
  }
  st = start;
  fill(ans, start, v, chk);
  fillback(ans, start, v, chk2);
  int idxmax = 1;
  int val = 0;
  for (int i = 1; i <= n; i++) {
    if (ans[i].size() <= 1) continue;
    if (ans[i].size() >= 3) {
      sort(ans[i].begin(), ans[i].end());
      int t = ans[i].size() - 1;
      int k = ans[i][t].first + ans[i][t - 1].first + ans[i][t - 2].first;
      if (k > val) {
        val = k;
        idxmax = i;
      }
    }
    if (ans[i].size() == 2) {
      int k = ans[i][0].first + ans[i][1].first;
      if (k > val) {
        val = k;
        idxmax = i;
      }
    }
  }
  cout << val << endl;
  if (ans[idxmax].size() == 2) {
    cout << idxmax << " " << ans[idxmax][0].second << " "
         << ans[idxmax][1].second << endl;
  } else {
    int t = ans[idxmax].size();
    cout << ans[idxmax][t - 1].second << " " << ans[idxmax][t - 2].second << " "
         << ans[idxmax][t - 3].second << endl;
  }
  return 0;
}