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.*;
import java.util.*;

public class Main {

	static ArrayList<Integer>[] adjList;

	static int last;
	static final int INF = (int) 1e9;
	static int[] dist;
	static int [] par ; 
	
	static void bfs(int s, int n) {
		dist = new int[n];
		par = new int [n] ; 
		Arrays.fill(dist, INF);

		Queue<Integer> q = new LinkedList<>();
		q.add(s);
		dist[s] = 0;
		
		while (!q.isEmpty()) 
		{
			int u = q.poll();
			last = u;
			for (int v : adjList[u])
				if (dist[v] > dist[u] + 1) {
					dist[v] = dist[u] + 1;
					q.add(v);
					par[v] = u ; 
				}

		}

	}

	static int maxLev, ans;
	static int[] a;
	static long minAdj = INF;

	static void dfs2(int u, int p, int lev) 
	{
		par[u] = p ; 

		if (lev > maxLev) {
			maxLev = lev;
			ans = u;
		}
		for (int v : adjList[u])
			if (v != p) 
			{
				dfs2(v, u, lev + 1);
			}
	}

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();

		adjList = new ArrayList[n];

		for (int i = 0; i < n; i++)
			adjList[i] = new ArrayList<>();

		boolean [] marked = new boolean[n] ; 
		
		ArrayList<int [] > edgeList = new ArrayList<>() ; 
		for (int i = 0; i < n - 1; i++) {
			int u = sc.nextInt() - 1, v = sc.nextInt() - 1;
			adjList[u].add(v);
			adjList[v].add(u);
			edgeList.add(new int [] {u , v});
		}
		
		minAdj = INF;
		maxLev = -1;
		ans = -1;
		par = new int [n] ; 
		Arrays.fill(par, -1);
		dfs2(0, -1, 0);
		int first = ans + 1;
		
		minAdj = INF;
		maxLev = -1;
		Arrays.fill(par, -1);
		
		dfs2(ans, -1, 0);
		int second = ans + 1 ; 
		int third = 0 ; 
		while(ans != -1)
		{
			marked[ans] = true ; 
			if(ans + 1!= first && ans + 1!= second)
				third = ans + 1; 
			ans = par[ans] ; 
			
		}
		adjList = new ArrayList[n];

		for (int i = 0; i < n; i++)
			adjList[i] = new ArrayList<>();
		
		for(int [] e : edgeList)
		{
			int u = e[0] , v = e[1] ; 
			if(marked[u])
			{
				if(!marked[v])
				{
					adjList[first - 1].add(v);
					adjList[v].add(first - 1);
				}
			}
			else if(marked[v])
			{
				if(!marked[u])
				{
					adjList[first - 1].add(u);
					adjList[u].add(first - 1);
				}
			}
			else 
			{
				adjList[u].add(v);
				adjList[v].add(u);

			}
		}
		int maxEdges = maxLev ; 
		
		bfs(first - 1, n);
		for(int i = 0 ; i < n ; i ++)
		{
			int d = dist[i] ; 
			if(d < INF && maxLev + d > maxEdges && i + 1 != first && i + 1 != second)
			{
				maxEdges = maxLev + d;
				third = i + 1 ; 	
			}
		}
		out.println(maxEdges);
		out.println(first +" " + second+" "+third);
		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;

		Scanner() {
		}

		Scanner(String path) throws Exception {
			br = new BufferedReader(new FileReader(path));
		}

		String next() throws Exception {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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