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 ThreePathsOnATree
{
	
	static ArrayList<Edge>[] tree;
	static boolean[] removed;
	static int n;
	
	static int a;
	static int b;
	static int c;
	
	static int diam;
	static int max;
	
	static int[] dist;
	static int[] prev;
	static int[] lastEdge;

	public static void main(String[] args)
	{
		JS scan = new JS();
		int n = scan.nextInt();
		tree = new ArrayList[n];
		for(int i = 0; i < n; i++) tree[i] = new ArrayList<Edge>();
		for(int i = 0; i < n-1; i++) {
			int u = scan.nextInt()-1;
			int v = scan.nextInt()-1;
			tree[u].add(new Edge(i, v));
			tree[v].add(new Edge(i, u));
		}
		dist = new int[n];
		prev = new int[n];
		lastEdge = new int[n];
		removed = new boolean[n-1];
		dfs(0, -1);
		int start = 0;
		int longest = 0;
		for(int i = 0; i < n; i++) {
			if(dist[i] > longest) {
				longest = dist[i];
				start = i;
			}
		}
//		System.out.println("a");
		Arrays.fill(dist, 0);
		a = start;
		dfs(start, -1);
		longest = 0;
		for(int i = 0; i < n; i++) {
			if(dist[i] > longest) {
				longest = dist[i];
				b = i;
			}
		}
//		System.out.println("b");
		prev[a] = -1;
		int curr = b;
		diam = longest;
		Arrays.fill(dist, 0);
//		System.out.println(a+" "+b);
//		System.out.println(Arrays.toString(prev));
//		System.out.println(Arrays.toString(lastEdge));
//		int iter = 0;
//		System.out.println();
		while(curr != -1) {
//			iter++;
//			if(iter == 5) break;			
			removed[lastEdge[curr]] = true;
			
//			System.out.println(lastEdge[curr]);
//			System.out.println(curr+" "+prev[curr]);
//			System.out.println(Arrays.toString(removed));
//			System.out.println(Arrays.toString(prev));
//			System.out.println();
			
			dfs(curr, -1);
			curr = prev[curr];
		}
		longest = 0;
		for(int i = 0; i < n; i++) {
			if(dist[i] > longest) {
				longest = dist[i];
				c = i;
			}
		}
		max = longest;
//		System.out.println("c");
		a++;
		b++;
		c++;
		if(max == 0) {
			if(a != 1 && b != 1) c = 1;
			if(a != 2 && b != 2) c = 2;
			if(a != 3 && b != 3) c = 3;
		}
		
		System.out.println(diam+max);
		System.out.println(a+" "+b+" "+c);
	}
	
	static void dfs(int curr, int par) {
		for(Edge to : tree[curr]) {
			if(removed[to.id]) continue;
			if(to.to != par) {
				lastEdge[to.to] = to.id;
				prev[to.to] = curr;
				dist[to.to] = dist[curr]+1;
				dfs(to.to, curr);
			}
		}
	}
	
	static class Edge{
		
		int id;
		int to;
		
		public Edge(int id, int to) {
			this.id = id;
			this.to = to;
		}
	}

	static class JS{
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}				
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
	}
}