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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Queue;
import java.util.LinkedList;
import java.io.InputStream;

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

    static class FThreePathsOnATree {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            int n = s.nextInt();
            HashMap<Integer, ArrayList<Integer>> map = FThreePathsOnATree.Tree.takeInput(n, s);
            findDiameter(map, n);
        }

        private void findDiameter(HashMap<Integer, ArrayList<Integer>> map, int n) {
            HashSet<Integer> visited = new HashSet<>();
            int src = dfs(map, 1, visited);
            visited.clear();
            int dest = dfs(map, src, visited);
            ArrayList<Integer> list = dfs1(src, dest, map);
            int ans = list.size() - 1;
            visited.clear();
            FThreePathsOnATree.pair a = bfs(list, map, visited);
            int b = a.last;
            if (a.last == -1) {
                for (int i = 1; i <= n; i++) {
                    if (i != src && i != dest) {
                        b = i;
                        break;
                    }
                }
            }
            System.out.println(ans + a.count);
            System.out.println(src + " " + dest + " " + b);
        }

        private FThreePathsOnATree.pair bfs(ArrayList<Integer> list, HashMap<Integer, ArrayList<Integer>> map, HashSet<Integer> visited) {
            Queue<Integer> q = new LinkedList<>(list);
            for (Integer i : list) {
                visited.add(i);
            }
            q.add(null);
            int count = 0;
            int last = -1;
            while (!q.isEmpty()) {
                Integer curr = q.poll();
                if (curr == null) {
                    curr = q.poll();
                    if (curr == null) {
                        return new FThreePathsOnATree.pair(last, count);
                    }
                    q.add(null);
                    count++;
                }

                ArrayList<Integer> list1 = map.get(curr);
                for (Integer i : list1) {
                    if (!visited.contains(i)) {
                        q.add(i);
                        visited.add(i);
                        last = i;
                    }
                }
            }

            return new FThreePathsOnATree.pair(last, count);
        }

        private ArrayList<Integer> dfs1(int src, int dest, HashMap<Integer, ArrayList<Integer>> map) {
            HashMap<Integer, Integer> parent = new HashMap<>();
            HashSet<Integer> visited = new HashSet<>();
            parent.put(src, src);
            Queue<Integer> q = new LinkedList<>();
            q.add(src);
            visited.add(src);
            while (!q.isEmpty()) {
                Integer curr = q.poll();
                if (curr == null) {
                    curr = q.poll();
                    if (curr == null) {
                        break;
                    }
                }

                ArrayList<Integer> list = map.getOrDefault(curr, new ArrayList<>());
                for (Integer i : list) {
                    if (!visited.contains(i)) {
                        q.add(i);
                        visited.add(i);
                        parent.put(i, curr);
                    }
                }

            }


            ArrayList<Integer> list = new ArrayList<>();
            int curr = dest;
            while (parent.get(curr) != curr) {
                list.add(curr);
                curr = parent.get(curr);
            }

            list.add(curr);
            return list;
        }

        private int dfs(HashMap<Integer, ArrayList<Integer>> map, int src, HashSet<Integer> visited) {
            Queue<Integer> q = new LinkedList<>();
            q.add(src);
            visited.add(src);
            q.add(null);
            int last = -1;
            while (!q.isEmpty()) {
                Integer curr = q.poll();
                if (curr == null) {
                    curr = q.poll();
                    if (curr == null) {
                        return last;
                    }
                    q.add(null);
                }

                ArrayList<Integer> list = map.getOrDefault(curr, new ArrayList<>());
                for (Integer i : list) {
                    if (!visited.contains(i)) {
                        q.add(i);
                        visited.add(i);
                    }
                }
                last = curr;
            }
            return -1;
        }

        private static class pair {
            int last;
            int count;

            public pair(int last, int count) {
                this.last = last;
                this.count = count;
            }

        }

        private static class Tree {
            public static HashMap<Integer, ArrayList<Integer>> takeInput(int size, FastReader s) {
                HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
                for (int i = 0; i < size - 1; i++) {
                    int src = s.nextInt();
                    int dest = s.nextInt();

                    ArrayList<Integer> list = map.getOrDefault(src, new ArrayList<>());
                    list.add(dest);
                    map.put(src, list);

                    list = map.getOrDefault(dest, new ArrayList<>());
                    list.add(src);
                    map.put(dest, list);
                }

                return map;
            }

        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

