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 int N = 2e5 + 1;
int n;
struct Event {
  int val;
  vector<int> v;
  Event(int _val) { val = _val; }
  void push(int w) { v.push_back(w); }
  bool operator<(const Event& e) const { return val < e.val; }
  Event& operator=(const Event& e) {
    vector<int> nv;
    nv.insert(nv.end(), e.v.begin(), e.v.end());
    val = e.val;
    v = nv;
    return *this;
  }
  Event operator+(const Event& e) const {
    Event ne = Event(val + e.val);
    ne.v.insert(ne.v.end(), v.begin(), v.end());
    ne.v.insert(ne.v.end(), e.v.begin(), e.v.end());
    return ne;
  }
};
vector<Event> s, d, t;
vector<int> adj[N];
bool cmp(pair<Event, int>& le, pair<Event, int>& re) {
  return re.first < le.first;
}
void dfs(int v, int p) {
  s[v] = Event(0);
  s[v].push(v);
  d[v] = Event(-1);
  t[v] = Event(-1);
  vector<pair<Event, int> > sv, dv, tv;
  for (int i = 0; i < adj[v].size(); i++) {
    int w = adj[v][i];
    if (w == p) continue;
    dfs(w, v);
    sv.push_back({s[w], w});
    dv.push_back({d[w], w});
    tv.push_back({t[w], w});
  }
  sort(sv.begin(), sv.end(), cmp);
  sort(dv.begin(), dv.end(), cmp);
  sort(tv.begin(), tv.end(), cmp);
  if (!sv.empty()) {
    if (d[v].val < sv[0].first.val + 1) {
      d[v] = sv[0].first;
      d[v].val++;
      d[v].push(v);
    }
    if (s[v].val < sv[0].first.val + 1) {
      s[v] = sv[0].first;
      s[v].val++;
    }
    if (sv.size() > 1) {
      Event ne = sv[0].first + sv[1].first;
      ne.val += 2;
      if (d[v] < ne) d[v] = ne;
      if (t[v] < ne) t[v] = ne;
      t[v].push(v);
    }
    if (sv.size() > 2) {
      Event ne = sv[0].first + sv[1].first + sv[2].first;
      ne.val += 3;
      if (t[v] < ne) t[v] = ne;
    }
  }
  if (!dv.empty()) {
    if (d[v].val < dv[0].first.val + 1) {
      d[v] = dv[0].first;
      d[v].val++;
    }
    if (t[v].val < dv[0].first.val + 1) {
      t[v] = dv[0].first;
      t[v].val++;
      t[v].push(v);
    }
  }
  if (!tv.empty() && t[v] < tv[0].first) {
    t[v] = tv[0].first;
  }
  if (!sv.empty() && !dv.empty()) {
    if (sv[0].second != dv[0].second) {
      Event ne = sv[0].first + dv[0].first;
      ne.val += 2;
      if (t[v] < ne) t[v] = ne;
    } else {
      if (sv.size() > 1) {
        Event ne = sv[1].first + dv[0].first;
        ne.val += 2;
        if (t[v] < ne) t[v] = ne;
      }
      if (dv.size() > 1) {
        Event ne = sv[0].first + dv[1].first;
        ne.val += 2;
        if (t[v] < ne) t[v] = ne;
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    s.push_back(Event(-1));
    d.push_back(Event(-1));
    t.push_back(Event(-1));
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a - 1].push_back(b - 1);
    adj[b - 1].push_back(a - 1);
  }
  dfs(0, -1);
  Event ans = Event(-1);
  for (int v = 0; v < n; v++) {
    if (ans < t[v]) ans = t[v];
  }
  cout << ans.val << "\n";
  for (int i = 0; i < ans.v.size(); i++) cout << ans.v[i] + 1 << " ";
  return 0;
}