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 INF = 0x3f3f3f3f;
vector<int> each[200000 + 1];
int n, max_dep[200000 + 1], final[200000 + 1], dp[200000 + 1],
    calced[200000 + 1];
pair<pair<int, int>, int> store[200000 + 1];
pair<int, int> store2[200000 + 1];
void dfs(int i, int prev) {
  if (calced[i]) return;
  calced[i] = 1;
  max_dep[i] = 0;
  for (auto it : each[i]) {
    if (it != prev) {
      dfs(it, i);
      max_dep[i] = max(max_dep[i], max_dep[it] + 1);
    }
  }
  dp[i] = -INF;
  int m1, m2, m3;
  m1 = m2 = m3 = -INF;
  store2[i] = make_pair(-INF, -INF);
  for (auto it : each[i]) {
    if (it != prev) {
      if (dp[it] > store2[i].second) store2[i].second = dp[it];
      if (store2[i].first < store2[i].second)
        swap(store2[i].first, store2[i].second);
      if (max_dep[it] > m3) m3 = max_dep[it];
      if (m2 < m3) swap(m2, m3);
      if (m1 < m2) swap(m1, m2);
    }
  }
  store[i] = make_pair(make_pair(m1, m2), m3);
  dp[i] = store2[i].first + 1;
  dp[i] = max(dp[i], m1 + m2 + 2);
}
void change(int now, int prev) {
  final[now] = dp[now];
  for (auto it : each[now]) {
    if (it != prev) {
      int s1 = dp[now], s2 = max_dep[now];
      if (store[now].first.first == max_dep[it])
        max_dep[now] = max(0, store[now].first.second + 1);
      else
        max_dep[now] = max(0, store[now].first.first + 1);
      if (store2[now].first == dp[it]) {
        dp[now] = store2[now].second + 1;
      } else
        dp[now] = store2[now].first + 1;
      if (store[now].first.first == max_dep[it]) {
        dp[now] = max(dp[now], store[now].first.second + store[now].second + 2);
      } else {
        if (store[now].first.second == max_dep[it]) {
          dp[now] =
              max(dp[now], store[now].first.first + store[now].second + 2);
        } else {
          dp[now] = max(dp[now],
                        store[now].first.first + store[now].first.second + 2);
        }
      }
      calced[it] = 0;
      dfs(it, -1);
      change(it, now);
      dp[now] = s1, max_dep[now] = s2;
    }
  }
}
int OK = 0;
void SEARCH(int now, int nt, int aim, int prev = -1) {
  if (OK) return;
  if (nt == aim) {
    OK = 1;
    cout << now << " ";
    return;
  }
  for (auto it : each[now]) {
    if (it != prev) {
      SEARCH(it, nt + 1, aim, now);
    }
  }
}
void print(int a, int prev = -1) {
  for (auto it : each[a]) {
    if (it != prev)
      if (dp[a] == dp[it] + 1) {
        print(it, a);
        return;
      }
  }
  int m1, m2;
  m1 = m2 = -INF;
  for (auto it : each[a]) {
    if (it != prev) {
      if (max_dep[it] > m2) m2 = max_dep[it];
      if (m1 < m2) swap(m1, m2);
    }
  }
  if (dp[a] != m1 + m2 + 2) {
    cout << "!erro\n";
    exit(0);
  }
  for (auto it : each[a]) {
    if (it != prev) {
      if (max_dep[it] == m1) {
        OK = 0;
        SEARCH(it, 0, m1, a);
        m1 = -1;
      } else {
        if (max_dep[it] == m2) {
          OK = 0;
          SEARCH(it, 0, m2, a);
          m2 = -1;
        }
      }
    }
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    int u, v;
    cin >> u >> v;
    each[u].push_back(v), each[v].push_back(u);
  }
  dfs(1, -1);
  change(1, -1);
  int res = 0;
  for (int i = 1; i <= n; ++i) res = max(res, final[i]);
  for (int i = 1; i <= n; ++i)
    if (final[i] == res) {
      memset(calced, 0, sizeof(calced));
      dfs(i, -1);
      cout << dp[i] << endl;
      cout << i << " ";
      print(i);
      break;
    }
  return 0;
}