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.
import java.lang.*;
import java.util.*;
import java.io.*;
public class Main {
    void solve() {
        int n=ni();
        g=new int[n+1][];
        int cnt[]=new int[n+1];
        int from[]=new int[n];
        int to[]=new int[n];
        for(int i=1;i<n;i++) {
            int u=ni(),v=ni();
            from[i]=u; to[i]=v;
            cnt[u]++;
            cnt[v]++;
        }
        for(int i=1;i<=n;i++) g[i]=new int[cnt[i]];
        for(int i=1;i<n;i++){
            int u=from[i],v=to[i];
            g[u][--cnt[u]]=v;
            g[v][--cnt[v]]=u;
        }
        dp=new int[n+1];
        dp2=new int[n+1];
        dp3=new int[n+1];
        mxId=new int[n+1];
        mxId2=new int[n+1];
        mxId3=new int[n+1];
        parent=new int[n+1];

        dfs(1,-1);
        dfs2(1,-1);
        pw.println(ans);
        pw.println(a[0]+" "+a[1]+" "+a[2]);

    }
    int g[][];
    int ans=0;
    int a[];
    int dp[];
    int dp2[];
    int dp3[];
    int mxId[];
    int mxId2[];
    int mxId3[];
    int parent[];
    void dfs(int v,int pr){
        mxId[v]=v;
        parent[v]=pr;
        dp3[v]=-1;
        for(int u : g[v]){
            if(u!=pr){
                dfs(u,v);
                if(dp[u]+1>=dp[v]){
                    dp3[v]=dp[v];
                    mxId3[v]=mxId[v];
                    dp[v]=dp[u]+1;
                    mxId[v]=mxId[u];
                }else if(dp[u]+1>=dp3[v]){
                    dp3[v]=dp[u]+1;
                    mxId3[v]=mxId[u];
                }
            }
        }
    }
    void dfs2(int v,int pr){
        if(pr!=-1){
            dp2[v]=dp2[pr]+1;
            mxId2[v]=mxId2[pr];
          // if( v==2) pw.println(mxId[pr]+" "+mxId3[pr]);
            if(mxId[v]==mxId[pr]){
                if(dp3[pr]!=-1 && dp3[pr]+1>dp2[v]){
                    dp2[v]=dp3[pr]+1;
                    mxId2[v]=mxId3[pr];
                }
            }else {
                if(dp[pr]+1>dp2[v]){
                    dp2[v]=dp[pr]+1;
                    mxId2[v]=mxId[pr];
                }
            }
        }else {
            mxId2[v]=v;
        }
        Pair p1=null,p2=null,p3=null;
        p1=new Pair(mxId2[v],dp2[v]);

        for(int u : g[v]){
            if(u!=pr){
                if(1+dp[u]>=p1.d){
                    p3=p2;
                    p2=p1;
                    p1=new Pair(mxId[u],1+dp[u]);
                }else if(p2==null || 1+dp[u]>=p2.d){
                    p3=p2;
                    p2=new Pair(mxId[u],1+dp[u]);
                }else if(p3==null || 1+dp[u]>=p3.d){
                    p3=new Pair(mxId[u],1+dp[u]);
                }
            }
        }
        if(p3!=null){

            int mx=p1.d+p2.d+p3.d;
            if(mx>ans){
                ans=mx;
                a=new int[]{p1.id,p2.id,p3.id};
            }
        }
       // if(v==2) pw.println(p1.id+" "+p2.id);

        if(pr==-1){
            p1=null; p2=null; p3=null;
            for(int u : g[v]){
                if(u!=pr){
                    if(p1==null || 1+dp[u]>=p1.d){
                        p3=p2;
                        p2=p1;
                        p1=new Pair(mxId[u],1+dp[u]);
                    }else if(p2==null || 1+dp[u]>=p2.d){
                        p3=p2;
                        p2=new Pair(mxId[u],1+dp[u]);
                    }else if(p3==null || 1+dp[u]>=p3.d){
                        p3=new Pair(mxId[u],1+dp[u]);
                    }
                }
            }
            if(p1!=null && p2!=null){
                int mx=p1.d+p2.d;
                if(mx>ans){
                    ans=mx;
                    a=new int[]{v,p1.id,p2.id};
                }
            }
        }else {
            if(p2!=null) {
                int mx=p1.d+p2.d;
                if(mx>ans){
                    ans=mx;
                    a=new int[]{v,p1.id,p2.id};
                }
            }
        }

        for(int u : g[v]){
            if(u!=pr){
                dfs2(u,v);

            }
        }

    }
    class Pair implements Comparable<Pair>{
        int id;
        int d;
        public Pair(int id,int d){
            this.id=id;
            this.d=d;
        }
        public int compareTo(Pair c){
            return Integer.compare(c.d,this.d);
        }
    }


    long M =(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";

    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");


    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++) map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

    private void tr(Object... o) {
        if (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }
}