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 mod = 1000000007;
long long inf = 1LL << 50;
const int N = 200000;
vector<vector<int>> tree(N + 5);
vector<deque<pair<int, int>>> bigs(N + 5);
int one, two, three;
int ans = 0;
void dfs2(int curr, int par, int best, int ind) {
  if (tree[curr].size() == 1) {
    for (int i : tree[curr]) {
      if (i != par) {
        dfs2(i, curr, best + 1, ind);
      }
    }
    return;
  }
  if (bigs[curr].size() == 3) {
    if (ans < bigs[curr][0].first + bigs[curr][1].first + bigs[curr][2].first) {
      ans = bigs[curr][0].first + bigs[curr][1].first + bigs[curr][2].first;
      one = bigs[curr][0].second;
      two = bigs[curr][1].second;
      three = bigs[curr][2].second;
    };
  }
  if (ans < bigs[curr][0].first + bigs[curr][1].first + best) {
    ans = bigs[curr][0].first + bigs[curr][1].first + best;
    one = bigs[curr][0].second;
    two = bigs[curr][1].second;
    three = ind;
  };
  for (int i : tree[curr]) {
    if (i != par) {
      if (bigs[i][0].first + 1 == bigs[curr][0].first) {
        if (best + 1 > bigs[curr][1].first + 1) {
          dfs2(i, curr, best + 1, ind);
        } else {
          dfs2(i, curr, bigs[curr][1].first + 1, bigs[curr][1].second);
        }
      } else {
        if (best + 1 > bigs[curr][0].first + 1) {
          dfs2(i, curr, best + 1, ind);
        } else {
          dfs2(i, curr, bigs[curr][0].first + 1, bigs[curr][0].second);
        }
      }
    }
  }
}
void dfs(int curr, int par) {
  for (int i : tree[curr]) {
    if (i != par) {
      dfs(i, curr);
      if (bigs[curr].size() < 3) {
        if (bigs[curr].size() == 0) {
          bigs[curr].emplace_back(bigs[i][0].first + 1, bigs[i][0].second);
        } else if (bigs[curr].size() == 1) {
          if (bigs[i][0].first + 1 > bigs[curr][0].first) {
            bigs[curr].emplace_front(bigs[i][0].first + 1, bigs[i][0].second);
          } else {
            bigs[curr].emplace_back(bigs[i][0].first + 1, bigs[i][0].second);
          }
        } else {
          if (bigs[i][0].first + 1 > bigs[curr][0].first) {
            bigs[curr].emplace_front(bigs[i][0].first + 1, bigs[i][0].second);
          } else if (bigs[curr][1].first < bigs[i][0].first + 1) {
            bigs[curr].emplace_back();
            bigs[curr][2] = bigs[curr][1];
            bigs[curr][1].first = bigs[i][0].first + 1;
            bigs[curr][1].second = bigs[i][0].second;
          } else {
            bigs[curr].emplace_back(bigs[i][0].first + 1, bigs[i][0].second);
          }
        }
      } else {
        if (bigs[curr][0].first < bigs[i][0].first + 1) {
          bigs[curr].emplace_front(bigs[i][0].first + 1, bigs[i][0].second);
          bigs[curr].pop_back();
        } else if (bigs[curr][1].first < bigs[i][0].first + 1) {
          bigs[curr][2] = bigs[curr][1];
          bigs[curr][1].first = bigs[i][0].first + 1;
          bigs[curr][1].second = bigs[i][0].second;
        } else if (bigs[curr][2].first < bigs[i][0].first + 1) {
          bigs[curr][2].first = bigs[i][0].first + 1;
          bigs[curr][2].second = bigs[i][0].second;
        }
      }
    }
  }
  if (bigs[curr].size() < 3) {
    bigs[curr].emplace_back(0, curr);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  dfs(0, -1);
  if (tree[0].size() == 1) {
    dfs2(tree[0][0], 0, 1, 0);
  } else {
    if (bigs[0].size() == 3) {
      if (ans < bigs[0][0].first + bigs[0][1].first + bigs[0][2].first) {
        ans = bigs[0][0].first + bigs[0][1].first + bigs[0][2].first;
        one = bigs[0][0].second;
        two = bigs[0][1].second;
        three = bigs[0][2].second;
      }
    }
    for (int i : tree[0]) {
      if (bigs[i][0].first + 1 == bigs[0][0].first) {
        dfs2(i, 0, bigs[0][1].first + 1, bigs[0][1].second);
      } else {
        dfs2(i, 0, bigs[0][0].first + 1, bigs[0][0].second);
      }
    }
  }
  cout << ans << "\n";
  cout << one + 1 << " " << two + 1 << " " << three + 1 << "\n";
}