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.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是最后一步
	ArrayList<Integer>[] graph;
	void work() {//上右下左 0---7
		int n=ni();
		graph=ng(n,n-1);
		int node1=-1,node2=-1,node3=-1;
		LinkedList<Integer> queue=new LinkedList<>();
		boolean[] vis=new boolean[n];
		queue.add(0);
		while(queue.size()>0) {
			int node=queue.poll();
			vis[node]=true;
			node1=node;
			for(int nn:graph[node]) {
				if(!vis[nn]) {
					queue.add(nn);
				}
			}
		}
		int[] pre=new int[n];
		queue.add(node1);
		vis=new boolean[n];
		while(queue.size()>0) {
			int node=queue.poll();
			vis[node]=true;
			node2=node;
			for(int nn:graph[node]) {
				if(!vis[nn]) {
					pre[nn]=node;
					queue.add(nn);
				}
			}
		}
		vis=new boolean[n];
		int r1=0,r2=0;
		int cur=node2;
		vis[cur]=true;
		while(cur!=node1) {
			r1++;
			cur=pre[cur];
			vis[cur]=true;
		}
		cur=node2;
		while(cur!=node1) {
			queue=new LinkedList<>();
			queue.add(cur);
			int cnt=-1,node4=-1;
			while(queue.size()>0) {
				cnt++;
				int len=queue.size();
				while(len-->0) {
					node4=queue.poll();
					vis[node4]=true;
					for(int nn:graph[node4]) {
						if(!vis[nn]) {
							queue.add(nn);
						}
					}
				}
				
			}
			if(cnt>r2) {
				r2=cnt;
				node3=node4;
			}
			cur=pre[cur];
		}
		if(node3==-1) {
			for(int i=0;i<n;i++) {
				if(i!=node1&&i!=node2) {
					node3=i;
					break;
				}
			}
		}
		out.println(r1+r2);
		out.println((node1+1)+" "+(node2+1)+" "+(node3+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());
	}
}