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

public class Abc {
    static ArrayList<Integer> adj[];
    static int n;
    static int max[][];
    static int child[][];
    static boolean mark[];
    static int maxAns;
    static int maxV;
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        n=sc.nextInt();
        adj=new ArrayList[n];
        for (int i=0;i<n;i++){
            adj[i]=new ArrayList<>();
        }
        max=new int[n][2];
        child=new int[n][2];
        mark=new boolean[n];
        int deg[]=new int[n];
        for (int i=0;i<n-1;i++){
            int a=sc.nextInt()-1,b=sc.nextInt()-1;
            adj[a].add(b);
            adj[b].add(a);
            deg[a]++;deg[b]++;
        }
        for (int i=0;i<n;i++){
            if (deg[i]==1){
                child[i][0]=i;
                child[i][1]=i;
            }
        }
        dfs(0,0);
        int ans=0;
        int src=-1,dest=-1;
        for (int i=0;i<n;i++){
            if (ans<max[i][0]+max[i][1]){
                ans=max[i][0]+max[i][1];
                src=child[i][0];
                dest=child[i][1];
            }
        }
//        System.out.println(src+" "+dest);
        dfs(src,dest,src);
        int c=-1,m=-1;
        for (int i=0;i<n;i++){
            if (mark[i] && i!=dest && i!=src){
                maxAns=0;
                maxV=i;
                maxdfs(i,i,0);
                if (m<maxAns){
                    m=maxAns;
                    c=maxV;
                }
            }
        }
//        System.out.println(ans);
        System.out.println(m+ans);
        System.out.println((src+1)+" "+(dest+1)+" "+(c+1));

    }
    static int dfs(int v,int par){
        for (int u:adj[v]){
            if (u!=par){
                int y=dfs(u,v)+1;
                if (max[v][0]<y){
                    max[v][1]=max[v][0];
                    max[v][0]=y;
                    child[v][1]=child[v][0];
                    child[v][0]=child[u][0];
                }else if (max[v][1]<y){
                    max[v][1]=y;
                    child[v][1]=child[u][0];
                }
            }
        }
        return max[v][0];
    }
    static boolean dfs(int src,int dest,int par){
        if (src==dest)return true;
        for (int u:adj[src]){
            if (u!=par){
                boolean x=dfs(u,dest,src);
                if (x){
                    mark[u]=true;
                    mark[src]=true;
                    return true;
                }
            }
        }
        return false;
    }
    static void maxdfs(int v,int par,int h){
        if (maxAns<h){
            maxAns=h;
            maxV=v;
        }
        for (int u:adj[v]){
            if (u!=par && !mark[u]){
                maxdfs(u,v,h+1);
            }
        }
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

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