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.util.*;


public class CP {
    public static void main(String[] args) throws Exception {
        new Solver().solve();
    }
}

class Solver {
    final Helper hp;
    final int MAXN = 1000_006;
    final long MOD = (long) 1e9 + 7;

    Solver() {
        hp = new Helper(MOD, MAXN);
        hp.initIO(System.in, System.out);
    }

    int N;
    ArrayList<Integer>[] graph;

    void solve() throws Exception {
        int i, j, k;

        N = hp.nextInt();
        graph = new ArrayList[N];
        for (i = 0; i < N; ++i) graph[i] = new ArrayList<>();

        for (i = 0; i < N - 1; ++i) {
            int a = hp.nextInt() - 1, b = hp.nextInt() - 1;
            graph[a].add(b); graph[b].add(a);
        }

        maxDist = new int[N][][];
        maxExcl = new int[N][][];
        dfs(0, -7);

        /*for (int[][] row : maxDist) if (row != null) {
            for (int[] itr : row) System.out.print(Arrays.toString(itr) + " ");
            System.out.println();
        }*/

        ans = 0; a = b = c = -7;
        dfs(0, -7, 0, 0);
        hp.println(ans);
        hp.printsp(a + 1);
        hp.printsp(b + 1);
        hp.printsp(c + 1);

        hp.flush();
    }

    int ans, a, b, c;

    void dfs(int node, int par, int upDist, int bestNode) {
        if (graph[node].isEmpty()) {
            return;
        }

        int i, children = graph[node].size();
        for (i = 0; i < children; ++i) {
            if (maxExcl[node][i][0] > upDist) {
                dfs(graph[node].get(i), node, maxExcl[node][i][0] + 1, maxExcl[node][i][1]);
            } else {
                dfs(graph[node].get(i), node, upDist + 1, bestNode);
            }
        }

        if (children >= 2) {
            Integer[] idx = new Integer[children];
            for (i = 0; i < children; ++i) idx[i] = i;
            Arrays.sort(idx, (a, b) -> -Integer.compare(maxDist[node][a][0], maxDist[node][b][0]));

            int temp = upDist + maxDist[node][idx[0]][0] + maxDist[node][idx[1]][0];
            if (temp > ans) {
                ans = temp; a = bestNode; b = maxDist[node][idx[0]][1]; c = maxDist[node][idx[1]][1];
            }

            if (children > 2) {
                temp = maxDist[node][idx[0]][0] + maxDist[node][idx[1]][0] + maxDist[node][idx[2]][0];
                if (temp > ans) {
                    ans = temp; a = maxDist[node][idx[0]][1]; b = maxDist[node][idx[1]][1]; c = maxDist[node][idx[2]][1];
                }
            }
        } else {
            int temp = upDist + maxDist[node][0][0];
            if (temp > ans) {
                ans = temp;
                a = bestNode; b = node; c = maxDist[node][0][1];
            }
        }
    }

    int[][][] maxExcl, maxDist;

    int[] dfs(int node, int par) {
        int i;
        graph[node].remove((Object) par);
        int children = graph[node].size();
        if (children == 0) return new int[] {1, node};

        maxDist[node] = new int[children][2];
        for (i = 0; i < children; ++i) maxDist[node][i] = dfs(graph[node].get(i), node);

        maxExcl[node] = new int[children][2];
        int maxSoFar, bestNode;
        for (maxSoFar = i = 0, bestNode = node; i < children; ++i) {
            if (maxSoFar >= maxExcl[node][i][0]) {
                maxExcl[node][i][0] = maxSoFar;
                maxExcl[node][i][1] = bestNode;
            }
            if (maxDist[node][i][0] > maxSoFar) {
                maxSoFar = maxDist[node][i][0];
                bestNode = maxDist[node][i][1];
            }
        }
        for (maxSoFar = 0, i = children - 1, bestNode = node; i >= 0; --i) {
            if (maxSoFar >= maxExcl[node][i][0]) {
                maxExcl[node][i][0] = maxSoFar;
                maxExcl[node][i][1] = bestNode;
            }
            if (maxDist[node][i][0] > maxSoFar) {
                maxSoFar = maxDist[node][i][0];
                bestNode = maxDist[node][i][1];
            }
        }

        return new int[] {maxSoFar + 1, bestNode};
    }
}

class Helper {
    final long MOD;
    final int MAXN;
    final Random rnd;

    public Helper(long mod, int maxn) {
        MOD = mod;
        MAXN = maxn;
        rnd = new Random();
    }


    public static int[] sieve;
    public static ArrayList<Integer> primes;

    public void setSieve() {
        primes = new ArrayList<>();
        sieve = new int[MAXN];
        int i, j;
        for (i = 2; i < MAXN; ++i)
            if (sieve[i] == 0) {
                primes.add(i);
                for (j = i; j < MAXN; j += i) {
                    sieve[j] = i;
                }
            }
    }


    public static long[] factorial;

    public void setFactorial() {
        factorial = new long[MAXN];
        factorial[0] = 1;
        for (int i = 1; i < MAXN; ++i) factorial[i] = factorial[i - 1] * i % MOD;
    }

    public long getFactorial(int n) {
        if (factorial == null) setFactorial();
        return factorial[n];
    }

    public long ncr(int n, int r) {
        if (r > n) return 0;
        if (factorial == null) setFactorial();
        long numerator = factorial[n];
        long denominator = factorial[r] * factorial[n - r] % MOD;
        return numerator * pow(denominator, MOD - 2, MOD) % MOD;
    }


    public long[] getLongArray(int size) throws Exception {
        long[] ar = new long[size];
        for (int i = 0; i < size; ++i) ar[i] = nextLong();
        return ar;
    }

    public int[] getIntArray(int size) throws Exception {
        int[] ar = new int[size];
        for (int i = 0; i < size; ++i) ar[i] = nextInt();
        return ar;
    }

    public String[] getStringArray(int size) throws Exception {
        String[] ar = new String[size];
        for (int i = 0; i < size; ++i) ar[i] = next();
        return ar;
    }

    public String joinElements(long[] ar) {
        StringBuilder sb = new StringBuilder();
        for (long itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }


    public String joinElements(int[] ar) {
        StringBuilder sb = new StringBuilder();
        for (int itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }

    public String joinElements(String[] ar) {
        StringBuilder sb = new StringBuilder();
        for (String itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }

    public String joinElements(Object[] ar) {
        StringBuilder sb = new StringBuilder();
        for (Object itr : ar) sb.append(itr).append(" ");
        return sb.toString().trim();
    }


    public long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }


    public long max(long[] ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public int max(int[] ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public long min(long[] ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.min(ret, itr);
        return ret;
    }

    public int min(int[] ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.min(ret, itr);
        return ret;
    }


    public long sum(long[] ar) {
        long sum = 0;
        for (long itr : ar) sum += itr;
        return sum;
    }

    public long sum(int[] ar) {
        long sum = 0;
        for (int itr : ar) sum += itr;
        return sum;
    }

    public void shuffle(int[] ar) {
        int r;
        for (int i = 0; i < ar.length; ++i) {
            r = rnd.nextInt(ar.length);
            if (r != i) {
                ar[i] ^= ar[r];
                ar[r] ^= ar[i];
                ar[i] ^= ar[r];
            }
        }
    }

    public void shuffle(long[] ar) {
        int r;
        for (int i = 0; i < ar.length; ++i) {
            r = rnd.nextInt(ar.length);
            if (r != i) {
                ar[i] ^= ar[r];
                ar[r] ^= ar[i];
                ar[i] ^= ar[r];
            }
        }
    }

    public long pow(long base, long exp, long MOD) {
        base %= MOD;
        long ret = 1;
        while (exp > 0) {
            if ((exp & 1) == 1) ret = ret * base % MOD;
            base = base * base % MOD;
            exp >>= 1;
        }
        return ret;
    }


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


    public void initIO(InputStream is, OutputStream os) {
        try {
            in = is;
            bw = new BufferedWriter(new OutputStreamWriter(os));
        } catch (Exception e) {
        }
    }

    public void initIO(String inputFile, String outputFile) {
        try {
            in = new FileInputStream(inputFile);
            bw = new BufferedWriter(new OutputStreamWriter(
                    new FileOutputStream(outputFile)));
        } catch (Exception e) {
        }
    }

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

    public String next() throws Exception {
        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();
    }

    public int nextInt() throws Exception {
        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;
    }

    public long nextLong() throws Exception {
        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;
    }

    public void print(Object a) throws Exception {
        bw.write(a.toString());
    }

    public void printsp(Object a) throws Exception {
        print(a);
        print(" ");
    }

    public void println() throws Exception {
        bw.write("\n");
    }

    public void println(Object a) throws Exception {
        print(a);
        println();
    }

    public void flush() throws Exception {
        bw.flush();
    }
}