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.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.HashSet;
import java.util.LinkedList;


public class CF1294F {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		ArrayList<Integer>[] e = new ArrayList[n];
		for(int i=0; i<n; i++) e[i] = new ArrayList<>();
		for(int i=0; i<n-1; i++){
			String[] split = br.readLine().split(" ");
			int src = Integer.parseInt(split[0])-1;
			int dest = Integer.parseInt(split[1])-1;
			e[src].add(dest);
			e[dest].add(src);
		}
		BitSet visited = new BitSet();
		LinkedList<State> q = new LinkedList<>();
		q.add(new State(0, 0));
		visited.set(0);
		int maxDepth = 0;
		int endI = 0;
		while(!q.isEmpty()){
			State cur = q.poll();
			for(int next : e[cur.v])
				if(!visited.get(next)){
					visited.set(next);
					q.add(new State(next, cur.depth+1));
					if(cur.depth+1>maxDepth){
						maxDepth = cur.depth+1;
						endI = next;
					}
				}
		}
		visited.clear();
		q.clear();
		q.add(new State(endI, 0));
		visited.set(endI);
		int[] p = new int[n];
		maxDepth = 0;
		int endJ = -1;
		p[endI] = -1;
		while(!q.isEmpty()){
			State cur = q.poll();
			for(int next : e[cur.v])
				if(!visited.get(next)){
					visited.set(next);
					q.add(new State(next, cur.depth+1));
					p[next] = cur.v;
					if(cur.depth+1>maxDepth){
						maxDepth = cur.depth+1;
						endJ = next;
					}
				}
		}
//		System.out.println("DIAMETER: "+endI+" "+endJ+" depth = "+maxDepth);
		
		HashSet<Edge> path = new HashSet<>();
		int cur = endJ;
		while(p[cur]!=-1 && path.size()<maxDepth){
//			System.out.println(cur);
			path.add(new Edge(cur, p[cur]));
			cur = p[cur];
		}
		
//		System.out.println("Path edges: "+path);
//		int[] nonDiamEdges = new int[n];
//		int[] starts = {endI, endJ};
//		for(int i=0; i<2; i++){
		visited.clear();
		q.clear();
		q.add(new State(endI, 0));
		int max = -1, bestI = -1;
		while(!q.isEmpty()){
			State curS = q.poll();
//			nonDiamEdges[curS.v] = curS.depth;
			if(curS.depth>max && curS.v!=endI && curS.v!=endJ){
				max = curS.depth;
				bestI = curS.v;
			}
			for(int next : e[curS.v])
				if(!visited.get(next)){
					visited.set(next);
					q.add(new State(next, curS.depth + (path.contains(new Edge(curS.v, next)) ? 0 : 1))); 
				}
		}
		System.out.println(path.size()+max);
		System.out.println((endI+1)+" "+(endJ+1)+" "+(bestI+1));
	}
	
	static class State{
		int v, depth;
		
		State(int a, int b){
			v = a;
			depth = b;
		}
	}
	
	static class Edge{
		int src, dest;
		
		Edge(int a, int b){
			if(a>b){
				int temp = a;
				a = b;
				b = temp;
			}
			src = a;
			dest = b;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + dest;
			result = prime * result + src;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Edge other = (Edge) obj;
			if (dest != other.dest)
				return false;
			if (src != other.src)
				return false;
			return true;
		}
		
		public String toString(){
			return src+" "+dest;
		}
	}
}
