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.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;

/*
Прокрастинирую
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int INF = (int) (1e9 + 10);
    static final int MOD = (int) (1e9 + 7);
    static final int N = (int) (1e6);
    static final int LOGN = 60;
    static ArrayList<Integer>[] g;
    static int[] p, depth;

    static void dfs(int v, int from) {
        p[v] = from;
        for (int u : g[v]) {
            if (u != from) {
                depth[u] = depth[v] + 1;
                dfs(u, v);
            }
        }
    }

    static void solve() {
        int n = in.nextInt();

        g = new ArrayList[n];
        Arrays.setAll(g, gi -> new ArrayList<>());
        for (int i = 0; i < n - 1; i++) {
            int v = in.nextInt() - 1;
            int u = in.nextInt() - 1;
            g[v].add(u);
            g[u].add(v);
        }

        p = new int[n];
        depth = new int[n];
        depth[0] = 0;
        dfs(0, 0);

        int a = -1;
        for (int i = 0; i < n; i++) {
            if (a == -1 || depth[i] > depth[a]) {
                a = i;
            }
        }

        depth[a] = 0;
        dfs(a, a);

        int b = -1;
        for (int i = 0; i < n; i++) {
            if (b == -1 || depth[i] > depth[b]) {
                b = i;
            }
        }
        int ans = depth[b];

        boolean[] path = new boolean[n];
        path[a] = true;
        for (int v = b; v != a; v = p[v]) {
            depth[v] = 0;
            path[v] = true;
        }

        for (int v = b; v != a; v = p[v]) {
            for (int u : g[v]) {
                if (!path[u]) {
                    depth[u] = 1;
                    dfs(u, v);
                }
            }
        }

        int c = -1;
        for (int i = 0; i < n; i++) {
            if ((c == -1) || depth[i] > depth[c]) {
                if (i != a && i != b) {
                    c = i;
                }
            }
        }
        ans += depth[c];

        out.println(ans);
        out.println((a + 1) + " " + (b + 1) + " " + (c + 1));
    }

    public static void main(String[] args) throws FileNotFoundException {
        in = new FastReader(System.in);
//        in = new FastReader(new FileInputStream("input.txt"));
        out = new PrintWriter(System.out);
//        out = new PrintWriter(new FileOutputStream("output.txt"));


        int q = 1;

        while (q-- > 0) {
            solve();
        }

        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

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

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

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

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