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 fac[2000005];
void pre() {
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i < 200005; i++) fac[i] = (i * fac[i - 1]) % 1000000007;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return res % 1000000007;
}
long long ncr(long long n, long long r) {
  return ((fac[n] * power(fac[r], 1000000007 - 2)) % 1000000007 *
          power(fac[n - r], 1000000007 - 2)) %
         1000000007;
}
vector<long long> adj[200005], adj1[200005];
long long k1 = -1;
long long k2 = -1;
long long k3 = -1;
long long can1 = 0;
long long can4 = 0;
map<long long, long long> mp;
long long a1[200005];
long long b1[200005];
long long par[200005];
vector<long long> v2;
long long n;
void dfs1(long long s, long long lev, long long par) {
  if (lev > can1) {
    can1 = lev;
    k1 = s;
  }
  for (auto it : adj[s]) {
    if (it != par) dfs1(it, lev + 1, s);
  }
}
void dfs2(long long s, long long lev, long long par) {
  if (lev > can1) {
    can1 = lev;
    k2 = s;
  }
  for (auto it : adj[s]) {
    if (it != par) dfs2(it, lev + 1, s);
  }
}
void dfs3(long long s, long long des, long long pa) {
  par[s] = pa;
  if (s == des) {
    while (s != -1) {
      mp[s]++;
      v2.push_back(s);
      s = par[s];
    }
    for (int i = 0; i < n - 1; i++) {
      if (mp[a1[i]] > 0 && mp[b1[i]] > 0) {
      } else {
        adj1[a1[i]].push_back(b1[i]);
        adj1[b1[i]].push_back(a1[i]);
      }
    }
  }
  for (auto it : adj[s]) {
    if (it != pa) {
      dfs3(it, des, s);
    }
  }
}
void dfs4(long long s, long long lev, long long par) {
  if (lev > can4) {
    can4 = lev;
    can1 = s;
  }
  for (auto it : adj1[s]) {
    if (it != par) dfs4(it, lev + 1, s);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n - 1; i++) {
      cin >> a1[i] >> b1[i];
      adj[a1[i]].push_back(b1[i]);
      adj[b1[i]].push_back(a1[i]);
    }
    dfs1(1, 0, -1);
    can1 = 0;
    dfs2(k1, 0, -1);
    vector<long long> v;
    v.clear();
    dfs3(k1, k2, -1);
    long long temp = can1;
    long long ans = can1;
    can1 = 0;
    for (auto it : v2) {
      if (it != k1 && it != k2) {
        dfs4(it, 0, -1);
        long long p1 = temp + can4;
        if (p1 > ans) {
          ans = p1;
          k3 = can1;
        }
        can4 = 0;
      }
    }
    if (k3 == -1) {
      for (int i = 1; i <= n; i++) {
        if (i != k1 && i != k2) {
          k3 = i;
          break;
        }
      }
    }
    cout << ans << "\n";
    cout << k1 << " " << k2 << " " << k3 << endl;
  }
}