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.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;

public class F {

    // private static final Scanner in = new Scanner(new BufferedInputStream(System.in));
    private static final FastReader in = new FastReader();
    private static final PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new F().run();
    }

    List<Integer>[] graph;

    int[] parent;
    int[] nodeDepth;
    boolean[] visited;

    private void run() {
        var n = in.nextInt();
        graph = new List[n];
        parent = new int[n];
        nodeDepth = new int[n];
        visited = new boolean[n];

        for (var i = 0; i < n; i++) {
            graph[i] = new ArrayList<>();
        }
        for (var i = 1; i < n; i++) {
            var a = in.nextInt() - 1;
            var b = in.nextInt() - 1;
            graph[a].add(b);
            graph[b].add(a);
        }

        dfs(0, 0);
        int a = deepestNode();

        parent[a] = -1;
        nodeDepth[a] = 0;
        Arrays.fill(visited, false);
        dfs(a, 0);
        int b = deepestNode();
        int ans = nodeDepth[b];

        Arrays.fill(visited, false);
        int x = b;
        do {
            visited[x] = true;
            x = parent[x];
        } while (x != -1);

        Arrays.fill(nodeDepth, 0);
        x = b;
        do {
            dfs(x, 0);
            x = parent[x];
        } while (x != -1);

        int c = 0;
        for (var i = 0 ; i < n; i++) {
            if (c == a || c == b || nodeDepth[i] > nodeDepth[c]) {
                c = i;
            }
        }
        ans += nodeDepth[c];

        out.println(ans);

        a++;
        b++;
        c++;
        out.println(a + " " + b + " " + c);

        out.flush();
    }

    void dfs(int node, int depth) {
        visited[node] = true;
        nodeDepth[node] = depth;
        graph[node].forEach(next -> {
            if (!visited[next]) {
                parent[next] = node;
                dfs(next, depth + 1);
            }
        });
    }

    int deepestNode() {
        int max = 0;
        for (int i = 1; i < nodeDepth.length; i++) {
            if (nodeDepth[i] > nodeDepth[max]) {
                max = i;
            }
        }
        return max;
    }

}

class FastReader {

    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer in;

    public String next() {
        while (in == null || !in.hasMoreTokens()) {
            try {
                in = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return in.nextToken();
    }

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

}