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;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
const int INT_INF = (int)(2e9);
const ll LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
inline ll randint(ll a, ll b) {
  ll w = (_g() << 31LL) ^ _g();
  return a + w % (b - a + 1);
}
inline void fast_io() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
};
template <typename T>
inline T sign(T x) {
  return T(x > 0) - T(x < 0);
}
template <typename T, typename S>
inline ostream& operator<<(ostream& os, const pair<T, S> p) {
  cout << "[" << p.first << ";" << p.second << "]";
  return os;
}
template <typename T>
inline ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto el : v) cout << el << " ";
  return os;
}
template <typename T>
inline int ckmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline int ckmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int MAXN = 3e5;
vector<int> g[MAXN];
int n, d[MAXN], ban[MAXN];
int v1, v2, v3;
vector<int> cur, path;
pair<int, int> mx[MAXN];
void dfs(int u = 1, int p = -1, int s = 0) {
  d[u] = s;
  for (int v : g[u]) {
    if (v != p) {
      dfs(v, u, s + 1);
    }
  }
}
void findPath(int u, int v, int to) {
  cur.push_back(u);
  if (u == to) {
    path = cur;
  }
  for (int c : g[u]) {
    if (c != v) {
      findPath(c, u, to);
    }
  }
  cur.pop_back();
}
void calc(int u, int p, int num, int s = 0) {
  if (ckmax(mx[num].first, s)) {
    mx[num].second = u;
  }
  for (int v : g[u]) {
    if (ban[v] || v == p) continue;
    calc(v, u, num, s + 1);
  }
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  v1 = -1;
  for (int i = 1; i <= n; ++i) {
    if (v1 == -1 || d[i] > d[v1]) v1 = i;
  }
  dfs(v1);
  v2 = -1;
  for (int i = 1; i <= n; ++i) {
    if (v2 == -1 || d[i] > d[v2]) v2 = i;
  }
  findPath(v1, v1, v2);
  for (int i : path) {
    ban[i] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (ban[i] == 0) continue;
    mx[i].second = i;
    calc(i, i, i);
  }
  int ans = -INT_INF;
  for (int i = 1; i <= n; ++i) {
    if (ban[i] == 0 || i == v1 || i == v2) continue;
    if (d[v2] + mx[i].first > ans) {
      ans = d[v2] + mx[i].first;
      v3 = mx[i].second;
    }
  }
  cout << ans << "\n";
  cout << v1 << " " << v2 << " " << v3 << "\n";
}
int main() {
  fast_io();
  solve();
  return 0;
}