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 Main {
    public static void main(String[] args) throws IOException {
        FastReader scan = new FastReader();
        //PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("marathon.out")));
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)),true);
        Task solver = new Task();
        //int t = scan.nextInt();
        int t = 1;
        for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
        out.close();
    }
    static class Task {
 
        public void solve(int testNumber, FastReader sc, PrintWriter pw) {
            int n = sc.nextInt();
            ArrayList<ArrayList<Integer>> adjl = new ArrayList<>();
            for(int i=0;i<=n;i++){
                adjl.add(new ArrayList<>());
            }
            for(int i = 0;i<n-1;i++){
                int a = sc.nextInt();
                int b=  sc.nextInt();
                adjl.get(a).add(b);
                adjl.get(b).add(a);
            }
            int[] dist = new int[n+1];
            Arrays.fill(dist,Integer.MAX_VALUE);
            dist[1]=0;
            Queue<Integer> q = new LinkedList<>();
            q.add(1);
            int l=0;
            while(!q.isEmpty()){
                l = q.poll();
                for(int x : adjl.get(l)){
                    if(dist[l]+1<dist[x]){
                        dist[x]=dist[l]+1;
                        q.add(x);
                    }
                }
            }
            //System.out.println(Arrays.toString(dist));
            int[] dist2 = new int[n+1];
            Arrays.fill(dist2,Integer.MAX_VALUE);
            dist2[l]=0;
            int r = 0;
            q.add(l);
            while(!q.isEmpty()){
                r = q.poll();
                for(int x : adjl.get(r)){
                    if(dist2[r]+1<dist2[x]){
                        dist2[x]=dist2[r]+1;
                        q.add(x);
                    }
                }
            }
            int[] dist3 = new int[n+1];
            Arrays.fill(dist3,Integer.MAX_VALUE);
            dist3[l]=0;
            q.add(l);
            //System.out.println("ayy");
            for(int x = r;dist2[x]>0;){
                dist3[x]=0;
                for(int y : adjl.get(x)){
                    if(dist2[y]+1==dist2[x]){
                        q.add(y);
                        x=y;
                        break;
                    }
                }
            }
            //System.out.println(Arrays.toString(dist3));
            //System.out.println("ch");
            int y = 0;
            while(!q.isEmpty()){
                y = q.poll();
                for(int x : adjl.get(y)){
                    if(dist3[y]+1<dist3[x]){
                        dist3[x]=dist3[y]+1;
                        q.add(x);
                    }
                }
            }
            ArrayList<Integer> leaves = new ArrayList<>();
            for(int i=0;i<=n;i++){
            	if(adjl.get(i).size()==1){
            		leaves.add(i);
            	}
            }
            if(leaves.size()==3){
            	pw.println(n-1);
            	pw.println(leaves.get(0)+" "+leaves.get(1)+" "+leaves.get(2));
            	return;
            }
            if(n==3){
            	pw.println(2);
            	pw.println(1+" "+2+" "+3);
            	return;
            }
            if(leaves.size()==2){
            	pw.println(n-1);
            	pw.print(leaves.get(0)+" "+leaves.get(1));
                int ret = 1;
                while(adjl.get(ret).size() == 1) ret++;
                pw.print(" "+ret+"\n");
            	return;
            }
            //System.out.println(Arrays.toString(dist3));
            pw.println(dist3[y]+dist2[r]);
            pw.println(r+" "+l+" "+y);
            
 
        }
    }
    static class tup implements Comparable<tup>{
        int a, b;
        tup(int a, int b){
            this.a=a;
            this.b=b;
        }
 
        @Override
        public int compareTo(tup o) {
            return Integer.compare(Math.abs(b),Math.abs(o.b));
        }
    }
    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }
 
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }
 
        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;
        }
    }
 
}