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{
	static LinkedList<Integer>[]adj;
	static int farthest=0,maxDist=0;
	static void dfs(int i,int par,int dist) {
		if(dist>maxDist) {
			maxDist=dist;
			farthest=i;
		}
		for(int j:adj[i]) {
			if(par!=j) {
				dfs(j,i,dist+1);
			}
		}
	}
	static LinkedList<Integer>path;
	static boolean dfs2(int i,int par) {
		if(i==farthest) {
			path.add(i);
			return true;
		}
		for(int j:adj[i]) {
			if(par!=j) {
				if(dfs2(j,i)) {
					path.add(i);
					return true;
				}
			}
		}
		return false;
	}
	public static void main(String[] args) throws Exception{
		MScanner sc=new MScanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int n=sc.nextInt();
		adj=new LinkedList[n];
		for(int i=0;i<n;i++)adj[i]=new LinkedList<Integer>();
		for(int i=0;i<n-1;i++) {
			int x=sc.nextInt()-1,y=sc.nextInt()-1;
			adj[x].add(y);adj[y].add(x);
		}
		path=new LinkedList<Integer>();
		dfs(0, -1, 0);
		int far1=farthest;
		maxDist=0;
		dfs(far1,-1,0);
		int far2=farthest;
		dfs2(far1, -1);
		LinkedList<Integer>q=new LinkedList<Integer>();
		int[]dist=new int[n];
		Arrays.fill(dist, 10000000);
		int middle=-1;
		for(int i:path) {
			if(i!=far1 && i!=far2) {
				middle=i;
			}
			dist[i]=0;
			q.add(i);
		}
		while(!q.isEmpty()) {
			int u=q.poll();
			for(int j:adj[u]) {
				if(dist[u]+1<dist[j]) {
					dist[j]=dist[u]+1;
					q.add(j);
				}
			}
		}
		int max=middle,dis=dist[middle];
		for(int i=0;i<n;i++) {
			if(dist[i]>dis && dist[i]!=10000000) {
				max=i;dis=dist[i];
			}
		}
		far1++;far2++;max++;
		pw.println(maxDist+dis);
		pw.println(far1+" "+far2+" "+max);
		pw.flush();
	}	
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] takearr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] takearrl(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public Integer[] takearrobj(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] takearrlobj(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}