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.
import java.util.*;
import java.io.*;
import javafx.util.Pair;
public class F615
{
    static int memo[][];
    static int [] depth; static int [] depth2; static int [] parent;
    static ArrayList<Integer> [] adj;
    static int log, node, partner;
    public static void main(String [] args)
    {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        adj = new ArrayList [n + 1];
        log = (int)Math.ceil(Math.log(n) / Math.log(2));
        memo = new int[n + 1][log + 1];
        depth = new int[n + 1];
        parent = new int [n+1];
        for (int i = 0; i <= n; i++)
            Arrays.fill(memo[i], -1);
        for (int i = 1; i <= n; i++) adj[i] = new ArrayList<>();
        for (int i = 0; i < n - 1; i++) {
            int a = sc.nextInt(); int b = sc.nextInt();
            adj[a].add(b); adj[b].add(a);
        }
        dfs(1, 1);
        int maxDepth = 0; node = 1;
        for (int i = 1; i <= n; i++) {
            if (depth[i] > maxDepth) {
                maxDepth = depth[i];
                node = i;
            }
        }
        depth2 = new int [n+1];
        dfs2(node, 0, node);
        partner = node; int bestDepth = 0;
        for (int i = 1; i <= n; i++) {
            if (depth2[i] > bestDepth) {
                bestDepth = depth2[i];
                partner = i;
            }
        }
        int diameter = depth[node] +depth[partner] - 2 * depth[lca(partner, node)]; int last = -1; int ans = 0;
        if (diameter == n - 1) {
            for (int i = 1; i <= n; i++) {
                if (i != node && i != partner) {
                    last = i;
                    break;
                }
            }
            ans = diameter;
        } else {
            int lca = lca(node, partner);
            int cur1 = node; int cur2 = partner;
            ArrayList<Integer> diam = new ArrayList<>();
            diam.add(lca);
            while (cur1 != lca) {
                diam.add(cur1);
                cur1 = parent[cur1];
            }
            while (cur2 != lca) {
                diam.add(cur2);
                cur2 = parent[cur2];
            }
            LinkedList<Pair<Integer, Integer>> q = new LinkedList<>();
            boolean [] visited = new boolean[n+1]; int max = 0;
            for (Integer node: diam) {
                q.add(new Pair(node, 0));
                visited[node] = true;
            }
            while (!q.isEmpty()) {
                Pair<Integer, Integer> cur = q.poll();
                if (cur.getValue() > max) {
                    max = cur.getValue();
                    last = cur.getKey();
                }
                visited[cur.getKey()] = true;
                for (Integer next: adj[cur.getKey()]) {
                    if (!visited[next]) {
                        q.add(new Pair<>(next, cur.getValue() + 1));
                    }
                }
            }
            ans = diameter + max;
        }
        out.println(ans);
        out.println(node + " " + partner + " " + last);
        out.close();
    }


    static void dfs(int u, int p)
    {

        // Using recursion formula to calculate
        // the values of memo[][]
        parent[u] = p;
        memo[u][0] = p;
        for (int i = 1; i <= log; i++)
            memo[u][i] = memo[memo[u][i - 1]][i - 1];
        for (int v : adj[u]) {
            if (v != p) {

                // Calculating the level of each node
                depth[v] = depth[u] + 1;
                dfs(v, u);
            }
        }
    }

    static void dfs2(int cur, int depth, int par) {
        depth2[cur] = depth;
        for (int v: adj[cur]) {
            if (v != par) {
                dfs2(v, depth + 1, cur);
            }
        }
    }


    static int lca(int u, int v)
    {
        // The node which is present farthest
        // from the root node is taken as u
        // If v is farther from root node
        // then swap the two
        if (depth[u] < depth[v]) {
            int temp = u;
            u = v;
            v = temp;
        }

        // Finding the ancestor of u
        // which is at same level as v
        for (int i = log; i >= 0; i--) {
            if ((depth[u] - (int)Math.pow(2, i)) >= depth[v])
                u = memo[u][i];
        }

        // If v is the ancestor of u
        // then v is the LCA of u and v
        if (u == v)
            return u;

        // Finding the node closest to the root which is
        // not the common ancestor of u and v i.e. a node
        // x such that x is not the common ancestor of u
        // and v but memo[x][0] is
        for (int i = log; i >= 0; i--) {
            if (memo[u][i] != memo[v][i]) {
                u = memo[u][i];
                v = memo[v][i];
            }
        }

        // Returning the first ancestor
        // of above found node
        return memo[u][0];
    }




    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

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

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

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }



    }

}