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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ThreePathsonATree solver = new ThreePathsonATree();
        solver.solve(1, in, out);
        out.close();
    }

    static class ThreePathsonATree {
        ArrayList<Integer>[] tree;
        int maxD;
        int maxN;
        boolean[] marked;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            tree = new ArrayList[N];
            for (int i = 0; i < N; i++) {
                tree[i] = new ArrayList<>();
            }
            for (int i = 0; i < N - 1; i++) {
                int a = in.nextInt() - 1;
                int b = in.nextInt() - 1;
                tree[a].add(b);
                tree[b].add(a);
            }
            int[] res = findDiameter();
            for (int i : res) {
                out.println(i);
            }
        }

        int[] farthest(int N, int P, int D) {
            if (N == P) {
                maxD = 0;
                maxN = 0;
            }
            for (int i : tree[N]) {
                if (i != P && !marked[i]) {
                    farthest(i, N, D + 1);
                }
            }
            if (D > maxD) {
                maxD = D;
                maxN = N;
            }
            return new int[]{maxD, maxN};
        }

        boolean mark(int n, int p, int b) {
            if (b == n) {
                marked[n] = true;
                return true;
            } else {
                for (int i : tree[n]) {
                    if (i != p) {
                        marked[n] = mark(i, n, b) || marked[n];
                    }
                }
            }
            return marked[n];
        }

        int mex(int a, int b) {
            if (Math.min(a, b) > 0) {
                return 0;
            }
            if (Math.min(a, b) == 0 && Math.max(a, b) == 1) {
                return 2;
            }
            return 1;
        }

        int[] findDiameter() {
            marked = new boolean[tree.length];
            int[] a = farthest(0, 0, 0);
            int[] b = farthest(a[1], a[1], 0);
            mark(a[1], a[1], b[1]);
            int[] mx = new int[2];
            for (int i = 0; i < tree.length; i++) {
                if (marked[i]) {
                    int[] next = farthest(i, i, 0);
                    if (next[0] > mx[0]) {
                        mx = next;
                    }
                }
            }
            if (mx[0] == 0) {
                mx[1] = mex(a[1], b[1]);
            }
            return new int[]{b[0] + mx[0], a[1] + 1, b[1] + 1, mx[1] + 1};
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}