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 inf = 1e9;
const long long MOD = 1e9 + 7;
const long long MAX_N = 1e5;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long vis[200005];
vector<long long> v[200005];
long long h[200005];
long long p[200005];
bool yata[200005];
void dfs(long long ini) {
  vis[ini] = 1;
  for (int i = 0; i < v[ini].size(); i++) {
    long long vecino = v[ini][i];
    if (!vis[vecino]) {
      h[vecino] = h[ini] + 1;
      dfs(vecino);
    }
  }
}
void dfs1(long long ini) {
  vis[ini] = 1;
  for (int i = 0; i < v[ini].size(); i++) {
    long long vecino = v[ini][i];
    if (!vis[vecino]) {
      h[vecino] = h[ini] + 1;
      p[vecino] = ini;
      dfs1(vecino);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1);
  vector<pair<long long, long long> > ga;
  for (int i = 1; i < n + 1; i++) {
    ga.push_back(make_pair(h[i], i));
  }
  sort(ga.rbegin(), ga.rend());
  long long punto = ga[0].second;
  memset(vis, 0, sizeof(vis));
  memset(h, 0, sizeof(h));
  dfs(punto);
  ga.clear();
  for (int i = 1; i < n + 1; i++) {
    ga.push_back(make_pair(h[i], i));
  }
  sort(ga.rbegin(), ga.rend());
  long long punto2;
  for (int i = 0; i < ga.size(); i++) {
    if (ga[i].second != punto) {
      punto2 = ga[i].second;
      break;
    }
  }
  long long cur;
  memset(vis, 0, sizeof(vis));
  memset(h, 0, sizeof(h));
  dfs1(punto);
  long long ans2 = 0;
  long long aux = punto, aux1 = punto2;
  aux1 = punto2;
  yata[punto] = 1;
  yata[punto2] = 1;
  while (aux1 != punto) {
    aux1 = p[aux1];
    yata[aux1] = 1;
  }
  ga.clear();
  for (int i = 1; i < n + 1; i++) {
    ga.push_back(make_pair(h[i], i));
  }
  sort(ga.rbegin(), ga.rend());
  long long punto3 = 1;
  long long flag = 0;
  vector<long long> posibles;
  for (int i = 1; i < n + 1; i++) {
    if (yata[i] == 0) posibles.push_back(i);
  }
  vector<pair<long long, long long> > val;
  if (posibles.size() != 0) {
    long long cont = 0;
    for (int i = 0; i < posibles.size(); i++) {
      long long au = posibles[i];
      cont = 0;
      while (yata[au] == 0) {
        au = p[au];
        cont++;
      }
      val.push_back(make_pair(cont, posibles[i]));
    }
    if (val.size() != 0) {
      sort(val.rbegin(), val.rend());
      punto3 = val[0].second;
      ans2 += val[0].first;
      flag = 1;
    }
  }
  long long ans1 = 0;
  memset(vis, 0, sizeof(vis));
  memset(h, 0, sizeof(h));
  memset(p, 0, sizeof(p));
  for (int i = 1; i < n + 1; i++) {
    if (i != punto && i != punto2) {
      cur = i;
      break;
    }
  }
  dfs(punto);
  if (flag == 1)
    ans1 = h[punto2] + val[0].first;
  else
    ans1 = h[punto2];
  cout << ans1 << endl;
  if (flag == 1)
    cout << punto << " " << punto2 << " " << punto3 << endl;
  else
    cout << punto << " " << punto2 << " " << cur << endl;
  return 0;
}