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.util.*;
import java.io.*;
 
public class Main {
    static ArrayList<ArrayList<Integer>> map;
    static int[] p;
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        map = new ArrayList<>();
        p = new int[n];
        for(int i = 0; i < n; i++){
            map.add(new ArrayList<>());
        }
        for(int i = 0; i < n-1; i ++){
            int x = sc.nextInt()-1;
            int y = sc.nextInt()-1;
            map.get(x).add(y);
            map.get(y).add(x);
        }
        Pair da = dfs(0,-1,0);
        Pair db = dfs(da.s,-1,0);
        int vv = db.s;
        ArrayList<Integer> diam = new ArrayList<>();
    	while (vv != da.s) {
    		diam.add(vv);
    		vv = p[vv];
    	}
    	diam.add(da.s);
    	if (diam.size() == n) {
    	    pw.println(n-1);
    	    pw.println((diam.get(0) + 1)+ " " + (diam.get(1) + 1) + " " + (diam.get(n-1)+1));
    	} else {
    	    Deque<Integer> q = new ArrayDeque<>();
    	    int[] d = new int[n];
    	    Arrays.fill(d,-1);
    	    for(int v : diam){
    	        d[v] = 0;
    	        q.add(v);
    	    }
    		while (q.size() > 0) {
    			int v = q.poll();
    			//pw.println(v);
    			for (int to : map.get(v)) {
    				if (d[to] == -1) {
    					d[to] = d[v] + 1;
    					//pw.println(d[to]);
    					q.add(to);
    				}
    			}
    		}
    		Pair mx = new Pair(d[0], 0);
    		for (int v = 1; v < n; ++v) {
    		    if(mx.f <= d[v]){
    		        mx.f = d[v];
    		        mx.s = v;
    		    }
    		}
    		pw.println(diam.size()-1 + mx.f);
    	    pw.println((diam.get(0) + 1)+ " " + (mx.s + 1) + " " + (diam.get(diam.size()-1)+1));
    	}
        pw.flush();
    }
    
    public static Pair dfs(int v, int par, int dist) {
    	p[v] = par;
    	Pair res = new Pair(dist, v);
    	for (int to : map.get(v)) {
    		if (to == par) continue;
    		Pair res2 = dfs(to, v, dist + 1);
    		if(res.f < res2.f || (res.f == res2.f) && (res.s < res2.s)){
    		    res = res2;
    		}
    	}
    	return res;
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
}

class Pair{
    int f,s;
    public Pair(int f, int s){
        this.f = f;
        this.s = s;
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

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

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

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
