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.Arrays;
import java.util.Collection;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Queue;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
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);
        FThreePathsOnATree solver = new FThreePathsOnATree();
        solver.solve(1, in, out);
        out.close();
    }

    static class FThreePathsOnATree {
        public int da;
        public int db;
        boolean first;
        public int[] par;
        public ArrayList<Integer>[] g;
        public int max;

        public void bfs(int src, int n) {
            Queue<Integer> q = new LinkedList<>();
            int temp[] = new int[n];
            q.add(src);
            Arrays.fill(temp, -1);
            temp[src] = 0;
            while (q.size() != 0) {
                int f = q.poll();
                for (int x : g[f]) {
                    if (temp[x] == -1) {
                        par[x] = f;
                        temp[x] = temp[f] + 1;
                        q.add(x);
                    }
                }
            }
            int d = 0;
            int mmax = -1;
            for (int i = 0; i < n; i++) {
                if (temp[i] > mmax) {
                    mmax = temp[i];
                    d = i;
                }
            }
            max = mmax;
            if (first) {
                da = d;
            } else {
                db = d;
            }
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            first = true;
            par = new int[n];
            g = new ArrayList[n];
            for (int i = 0; i < n; i++) g[i] = new ArrayList<>();
            for (int i = 0; i < n - 1; i++) {
                int a = in.nextInt() - 1;
                int b = in.nextInt() - 1;
                g[a].add(b);
                g[b].add(a);
            }
            bfs(0, n);
            first = false;
            bfs(da, n);
            ArrayList<Integer> diameter = new ArrayList<>();
            int x = db;
            while (x != da) {
                diameter.add(x);
                x = par[x];
            }
            diameter.add(da);


            if (diameter.size() == n) {
                int dc = 0;
                for (int i = 0; i < n; i++) {
                    if (i != da && i != db) {
                        dc = i;
                        break;
                    }
                }
                out.println(n - 1);
                out.println((da + 1) + " " + (db + 1) + " " + (dc + 1));
                return;
            }


            int dist[] = new int[n];
            Arrays.fill(dist, -1);
            Queue<Integer> q = new LinkedList<>();
            for (int y : diameter) {
                dist[y] = 0;
                q.add(y);
            }
            while (!q.isEmpty()) {
                int f = q.poll();
                for (int temp : g[f]) {
                    if (dist[temp] == -1) {
                        dist[temp] = dist[f] + 1;
                        q.add(temp);
                    }
                }
            }
            int mmax = -1;
            int dc = 0;
            for (int i = 0; i < n; i++) {
                if (dist[i] > mmax) {
                    mmax = dist[i];
                    dc = i;
                }
            }
            out.println(diameter.size() - 1 + mmax);
            out.println((da + 1) + " " + (db + 1) + " " + (dc + 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());
        }

    }
}