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 {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=998244353;
	long gcd(long a,long b) {
		return a==0?gcd(b%a,a):b;
	}
	//偶数，*2是最后一步
	int[][][] dp;//pre last dis
	int max,node;
	ArrayList<Integer>[] graph;
	int[] ret;
	int max2=1,node2=-1;
	void work() {//上右下左 0---7
		int n=ni();
		dp=new int[n][2][];
		graph=ng(n,n-1);
		dfs1(0,new boolean[n]);
		ret=new int[3];
		Arrays.fill(ret, -1);
		ret[0]=dp[node][0][1];
		if(dp[node][1]==null) {
			ret[1]=node;
		}else {
			ret[1]=dp[node][1][1];
		}
		dfs2(dp[node][0][0]);
		if(dp[node][1]!=null) {
			boolean[] vis=new boolean[n];
			vis[dp[node][0][0]]=true;
			vis[dp[node][1][0]]=true;
			int[] r=dfs3(node,vis);
			if(r[0]>max2) {
				max2=r[0];
				node2=r[1];
			}
			dfs2(dp[node][1][0]);
		}
		if(node2==-1) {
			for(int i=0;i<n;i++) {
				if(i!=ret[0]&&i!=ret[1]) {
					ret[2]=i;
					break;
				}
			}
		}else {
			ret[2]=node2;
		}
		out.println(max+max2-2);
		out.println((ret[0]+1)+" "+(ret[1]+1)+" "+(ret[2]+1));
	}

	private int[] dfs3(int node, boolean[] vis) {
		vis[node]=true;
		int idx=node,d=0;
		for(int nn:graph[node]) {
			if(!vis[nn]) {
				int[] r=dfs3(nn,vis);
				if(r[0]>d) {
					d=r[0];
					idx=r[1];
				}
			}
		}
		return new int[] {d+1,idx};
	}

	private void dfs2(int node) {
		if(dp[node][1]!=null) {
			int d=dp[node][1][2];
			if(d>max2) {
				max2=d;
				node2=dp[node][1][1];
			}
		}
		if(node!=dp[node][0][0])dfs2(dp[node][0][0]);
	}

	private void dfs1(int node, boolean[] vis) {
		vis[node]=true;
		int node1=-1,d1=0,node2=-1,d2=0;
		for(int nn:graph[node]) {
			if(!vis[nn]) {
				dfs1(nn,vis);
				int d=dp[nn][0][2];
				if(d>d1) {
					node2=node1;
					d2=d1;
					node1=nn;
					d1=d;
				}else if(d>d2){
					node2=nn;
					d2=d;
				}
			}
		}
		if(d1+d2+1>max) {
			max=d1+d2+1;
			this.node=node;
		}
		if(node1==-1) {
			dp[node][0]=new int[] {node,node,1};
		}else {
			dp[node][0]=new int[] {node1,dp[node1][0][1],d1+1};
			if(node2>-1) {
				dp[node][1]=new int[] {node2,dp[node2][0][1],d2+1};
			}
		}
	}

	//input
	private ArrayList<Integer>[] ng(int n, int m) {
		ArrayList<Integer>[] graph=(ArrayList<Integer>[])new ArrayList[n];
		for(int i=0;i<n;i++) {
			graph[i]=new ArrayList<>();
		}
		for(int i=1;i<=m;i++) {
			int s=in.nextInt()-1,e=in.nextInt()-1;
			graph[s].add(e);
			graph[e].add(s);
		}
		return graph;
	}

	private int ni() {
		return in.nextInt();
	}

	private long nl() {
		return in.nextLong();
	}

	private long[] na(int n) {
		long[] A=new long[n];
		for(int i=0;i<n;i++) {
			A[i]=in.nextLong();
		}
		return A;
	}
	private int[] nia(int n) {
		int[] A=new int[n];
		for(int i=0;i<n;i++) {
			A[i]=in.nextInt();
		}
		return A;
	}
}	

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

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


	public String next() 
	{
		while(st==null || !st.hasMoreElements())//回车，空行情况
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

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

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