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.AbstractCollection;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.LinkedList;
import java.util.TreeSet;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
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 {
        ArrayList<Integer>[] a;
        boolean[] vis;
        TreeSet<pair<Integer, Integer>> t = new TreeSet<>();
        int d1 = 0;
        int d2 = 0;
        int mx = 0;

        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt();
            a = new ArrayList[n];
            for (int i = 0; i < n; i++) a[i] = new ArrayList<>();
            for (int i = 1; i < n; i++) {
                int u = s.nextInt() - 1, v = s.nextInt() - 1;
                a[u].add(v);
                a[v].add(u);
            }
            vis = new boolean[n];
            dfs(0, 0);
            d1 = d2;
            vis = new boolean[n];
            dfs(d1, 0);
            vis = new boolean[n];
            dfs2(d1, d2);

            int ind = -1;

            LinkedList<pair<Integer, Integer>> l = new LinkedList<>();
            l.add(new pair<>(d1, 0));
            l.add(new pair<>(d2, 0));
            int[] dis = new int[n];
            TreeSet<pair<Integer, Integer>> vis = new TreeSet<>();
            while (!l.isEmpty()) {
                pair<Integer, Integer> p = l.poll();
                dis[p.x] += p.y;
                for (int i : a[p.x])
                    if (!vis.contains(new pair<>(i, p.x))) {
                        vis.add(new pair<>(i, p.x));
                        vis.add(new pair<>(p.x, i));
                        if (t.contains(new pair<>(i, p.x))) l.add(new pair<>(i, p.y));
                        else l.add(new pair<>(i, p.y + 1));
                    }
            }

            int max = -1;
            for (int i = 0; i < n; i++)
                if (i != d1 && i != d2 && max < dis[i]) {
                    max = dis[i];
                    ind = i;
                }

            w.println(max + mx);
            w.println((d1 + 1) + " " + (d2 + 1) + " " + (ind + 1));
        }

        void dfs(int cur, int dis) {
            vis[cur] = true;
            if (dis >= mx) {
                mx = dis;
                d2 = cur;
            }
            for (int i : a[cur]) if (!vis[i]) dfs(i, dis + 1);
        }

        void dfs2(int cur, int to) {
            vis[cur] = true;
            if (cur == to) return;
            for (int i : a[cur])
                if (!vis[i]) {
                    dfs2(i, to);
                    if (vis[to]) {
                        t.add(new pair<>(cur, i));
                        t.add(new pair<>(i, cur));
                        return;
                    }
                }
        }

    }

    static class pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<pair<U, V>> {
        public U x;
        public V y;

        public pair(U x, V y) {
            this.x = x;
            this.y = y;
        }

        public int compareTo(pair<U, V> other) {
            int i = x.compareTo(other.x);
            if (i != 0) return i;
            return y.compareTo(other.y);
        }

        public String toString() {
            return x.toString() + " " + y.toString();
        }

        public boolean equals(Object obj) {
            if (this.getClass() != obj.getClass()) return false;
            pair<U, V> other = (pair<U, V>) obj;
            return x.equals(other.x) && y.equals(other.y);
        }

        public int hashCode() {
            return 31 * x.hashCode() + y.hashCode();
        }

    }

    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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        }

    }
}