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 PYTHON):

Solution:
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

n = int(input())
edge = [ [] for i in range(1+n)]
for i in range(n-1):
	a,b = map(int,raw_input().split(" "))
	edge[a].append(b)
	edge[b].append(a)

root = 1
arr = [1]
depth = [0]*(1+n)
depthv = range(1+n)
visited = [0]*(1+n)
visited[1] = 1
fa = [0]*(1+n)
dp = [0]*(1+n)
dpv = [1]*(1+n)
i = 0
while i < n:
	node = arr[i]
	for v in edge[node]:
		if not visited[v]:
			visited[v] = 1
			arr.append(v) 
		else:
			fa[node] = v
	i += 1

for i in range(n):
	node = arr[n-1-i]
	maxv = 0
	maxi = node
	for v in edge[node]:
		if depth[v] > maxv:
			maxv = depth[v]
			maxi = v
	depthv[node] = depthv[maxi]
	depth[node] = maxv+1

sons = [ []for i in range(1+n)]

for i in range(1,n+1):
	for v in edge[i]:
		if v != fa[i]:
			sons[i].append((depth[v],v))
	if len(sons[i]) == 0:
		continue
	sons[i].sort(reverse = True)


for i in arr:
	if len(sons[i]) == 0:
		continue
	for v in edge[i]:
		if v != fa[i]:
			dp[v] = dp[i] +1
			dpv[v] = dpv[i]
			if v == sons[i][0][1]:
				if len(sons[i])>1:
					if sons[i][1][0]+1 > dp[v]:
						dp[v] = sons[i][1][0]+1
						dpv[v] = depthv[sons[i][1][1]]
			else:
				if sons[i][0][0] +1 > dp[v]:
					dp[v] = sons[i][0][0]+1
					dpv[v] = depthv[sons[i][0][1]]
def mysum(arr):
	s = 0
	for a,b in arr:
		s += a
	return s

def get(dpethv,sons,k):
	if len(sons) >= k:
		return [depthv[s[1]] for s in sons[:k]]
	else:
		return [depthv[s[1]] for s in sons[:k]]+[1]*(k-len(sons))

ans = 0
for i in range(1,n+1):
	
	if len(sons[i]) == 0:
		continue
	if mysum(sons[i][:2])+dp[i]>ans:
		ans = mysum(sons[i][:2])+dp[i]
		a,b = get(depthv,sons[i],2)
		c = dpv[i]

	if mysum(sons[i][:3]) > ans:
		ans = mysum(sons[i][:3])
		a,b,c = get(depthv,sons[i],3)
	
# 	print ans,a,b,c
# print depthv,depth
# print dpv,dp
print ans
if len(set([a,b,c]))<3:
	tmp = list(set([a,b,c]))
	a,b = tmp
	for i in range(1,n+1):
		if i!= a and i != b:
			c= i
			break
	print a,b,c

else:
	print a,b,c