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

Solution:
import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	global ans
	n = mint()
	e = [[] for i in range(n)]
	D = [0]*n
	ans = 0
	ansv = [0,0,0]
	for i in range(n-1):
		a, b = mints()
		e[a-1].append(b-1)
		e[b-1].append(a-1)

	s = [0]*n
	p = [0]*n
	i = [0]*n
	d = [0]*n
	t = 0
	d[0] = (0,0)
	p[0] = -1
	while t >= 0:
		x = s[t]
		ii = i[t]
		if ii > 0:
			v = e[x][ii-1]
			if v != p[t]:
				dd = D[v]
				d[t] = min(d[t], (dd[0] - 1, dd[1]))
		if ii < len(e[x]):
			v = e[x][ii]
			i[t] = ii + 1
			if v != p[t]:
				t += 1
				s[t] = v
				p[t] = x
				d[t] = (0, v)
				i[t] = 0
		else:
			D[x] = d[t]
			t -= 1

	up = [0]*n
	upv = [0]*n
	a = [None]*n
	t = 0
	s[0] = 0
	p[0] = 0
	i[0] = 0
	aa = []
	for vv in e[0]:
		aa.append((D[vv][0] - 1, D[vv][1]))
		if len(aa) > 3:
			aa.sort()
			aa.pop()
	aa.append((0, 0))
	if len(aa) > 3:
		aa.sort()
		aa.pop()
	h = 0
	for dd, vv in aa:
		h -= dd
	if len(aa) == 3 and ans < h:
		ans = h
		for z in 0,1,2:
			ansv[z] = aa[z][1]
	a[0] = aa
	while t >= 0:
		x = s[t]
		ii = i[t]
		if ii < len(e[x]):
			v = e[x][ii]
			i[t] = ii + 1
			if v != p[t]:
				t += 1
				s[t] = v
				p[t] = x
				i[t] = 0
				aa = []
				dd = (D[v][0] - 1, D[v][1])
				b = (1, -1)
				for z in a[t-1]:
					if z != dd:
						b = min(b, z)
				if b[1] != v:
					aa.append((b[0]-1,b[1]))
				for vv in e[v]:
					if vv != x:
						aa.append((D[vv][0] - 1, D[vv][1]))
						if len(aa) > 3:
							aa.sort()
							aa.pop()
				aa.append((0, v))
				if len(aa) > 3:
					aa.sort()
					aa.pop()
				h = 0
				for dd, vv in aa:
					h -= dd
				if len(aa) == 3 and ans < h:
					ans = h
					for z in 0,1,2:
						ansv[z] = aa[z][1]
				a[t] = aa
		else:
			t -= 1
	print(ans)
	print(ansv[0]+1, ansv[1]+1, ansv[2]+1)

solve()