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.IOException;
import java.io.InputStream;
import java.util.*;

public class CP {
    static ArrayList<Integer> tree[];
    static int n;
    static int path[];
    static HashSet<Integer> set;

    public static Node findlast(int x, boolean ok) {
        int i, j, node, last = x;
        Queue<Integer> q = new LinkedList<Integer>();
        HashSet<Integer> visited = new HashSet<>();
        HashMap<Integer, Integer> pre = new HashMap<>();
        visited.add(x);
        q.add(x);
        while (!q.isEmpty()) {
            node = q.poll();
            last = node;
            for (int z : tree[node]) {
                if (!visited.contains(z) && !set.contains(z)) {
                    visited.add(z);
                    pre.put(z, node);
                    q.add(z);
                }
            }
        }
        int temp = last, dist = 0;
        while (temp != x) {
            temp = pre.get(temp);
            if (ok)
                path[dist] = temp;
            dist++;
        }
        return new Node(last, dist);
    }

    public static void main(String args[]) throws Exception {
        FastReader in = new FastReader(System.in);
        StringBuilder sb = new StringBuilder();
        int i, j, x, y;
        n = in.nextInt();
        path = new int[n + 1];
        tree = new ArrayList[n + 1];
        set = new HashSet<>();
        for (i = 1; i <= n; i++)
            tree[i] = new ArrayList<>();
        for (i = 1; i < n; i++) {
            x = in.nextInt();
            y = in.nextInt();
            tree[x].add(y);
            tree[y].add(x);
        }
        int a = findlast(1, false).last;
        Node nod = findlast(a, true);
        int b = nod.last;
        int dist = nod.dist;
        for (i = 0; i < dist; i++)
            set.add(path[i]);
        set.add(a);
        set.add(b);
        int mdist = -5;
        int c = -1;
        for (i = 0; i < (dist - 1); i++) {
            nod = findlast(path[i], false);
            if (nod.dist > mdist) {
                c = nod.last;
                mdist = nod.dist;
            }
        }
        System.out.println(dist + mdist);
        System.out.println(a + " " + b + " " + c);


    }
}

class Node {
    int last, dist;

    public Node(int l, int d) {
        last = l;
        dist = d;
    }
}

class FastReader {

    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;

    FastReader(InputStream is) {
        in = is;
    }

    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }

    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }

    String nextLine() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        StringBuilder sb = new StringBuilder();
        for (; c != 10 && c != 13; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }

    char nextChar() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan()) ;
        return (char) c;
    }

    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }

    long nextLong() throws IOException {
        int c;
        long val = 0;
        for (c = scan(); c <= 32; c = scan()) ;
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
}