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 ArrayList<Integer>[] g;
	static int[] visited,dp;
	static boolean[] v;
	static int bfs(int u) {
		int n=g.length;
		int[] distance=new int[n];
		Queue<Integer> q=new LinkedList<>();
		Arrays.fill(distance, -1);
		q.add(u);
		distance[u]=0;
		while(!q.isEmpty()) {
			int curr=q.poll();
			for(int i:g[curr]) {
				if(distance[i]==-1) {
					distance[i]=distance[curr]+1;
					q.add(i);
				}
			}
		}
		int ans=0;
		int mx=-1;
		for(int i=0;i<n;i++) {
			if(mx<distance[i]) {
				ans=i;
				mx=distance[i];
			}
		}
		return ans;
	}
	static int[] bfs2(int u) {
		int n=g.length;
		int[] distance=new int[n];
		Queue<Integer> q=new LinkedList<>();
		Arrays.fill(distance, -1);
		q.add(u);
		distance[u]=0;
		while(!q.isEmpty()) {
			int curr=q.poll();
			for(int i:g[curr]) {
				if(distance[i]==-1) {
					distance[i]=distance[curr]+1;
					q.add(i);
				}
			}
		}
		int ans=0;
		int mx=-1;
		for(int i=0;i<n;i++) {
			if(mx<distance[i]) {
				ans=i;
				mx=distance[i];
			}
		}
		return new int[] {ans,mx};
	}
	static boolean dfs(int u,int v) {
		if(u==v) {
			visited[u]=2;
			return true;
		}
		visited[u]=1;
		boolean f=false;
		for(int i:g[u]) {
			if(visited[i]==0) {
				f|=dfs(i,v);
			}
		}
		if(f) {
			visited[u]=2;
			return true;
		}
		return false;
	}
	static void dfs2(int u,int h) {
		v[u]=true;
		dp[u]=h;
		for(int i:g[u]) {
			if(!v[i]) {
				dfs2(i,h+1);
			}
		}
	}
	public static void main(String[] args) throws IOException 
	{ 
		FastScanner f = new FastScanner(); 
		int ttt=1;
//		ttt=f.nextInt();
		PrintWriter out=new PrintWriter(System.out);
		for(int tt=0;tt<ttt;tt++) {
			int n=f.nextInt();
			g=new ArrayList[n];
			visited=new int[n];
			for(int i=0;i<n;i++) g[i]=new ArrayList<>();
			for(int i=0;i<n-1;i++) {
				int u=f.nextInt()-1;
				int v=f.nextInt()-1;
				g[u].add(v);
				g[v].add(u);
			}
			int a=bfs(0);
			int[] temp=bfs2(a);
			int b=temp[0];
			int ans=temp[1];
//			System.out.println(ans+" "+a+" "+b);
			dfs(a,b);
			int c=-1;
//			System.out.println(Arrays.toString(visited));
			dp=new int[n];
			v=new boolean[n];
			for(int i=0;i<n;i++) {
				if(visited[i]==2) {
					for(int j:g[i]) {
						if(visited[j]==1) {
							v[i]=true;
							dfs2(j,1);
						}
					}
				}
			}
			int mx=-1;
			for(int i=0;i<n;i++) {
				if(dp[i]>mx && i!=a && i!=b) {
					mx=dp[i];
					c=i;
				}
			}
			System.out.println(ans+mx);
			System.out.println((a+1)+" "+(b+1)+" "+(c+1));
		}
		out.close();
	} 
	static void sort(int[] p) {
        ArrayList<Integer> q = new ArrayList<>();
        for (int i: p) q.add( i);
        Collections.sort(q);
        for (int i = 0; i < p.length; i++) p[i] = q.get(i);
    }
    
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		long[] readLongArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
	}
}