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, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
#from bisect import bisect_left as bl, bisect_right as br, insort
#from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
#from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write(' '.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
#from decimal import Decimal
#from fractions import Fraction
#sys.setrecursionlimit(100000)
#INF = float('inf')
mod = int(1e9)+7

n=int(data())
g=[[] for i in range(n+1)]
for i in range(n-1):
    u,v=mdata()
    g[u].append(v)
    g[v].append(u)
ind=1
for i in range(1,n+1):
    if len(g[i])==1:
        ind=i
        break
q=[ind]
v=[0]*(n+1)
vis=[0]*(n+1)
m=0
ans=0
while q:
    a=q.pop()
    vis[a]=1
    for i in g[a]:
        if vis[i]==0:
            q.append(i)
            v[i]=v[a]+1
            if v[i]>m:
                m=v[i]
                ind=i
x=ind
q=[ind]
v=[0]*(n+1)
par=[0]*(n+1)
m=0
while q:
    a=q.pop()
    for i in g[a]:
        if par[a]!=i:
            q.append(i)
            v[i]=v[a]+1
            par[i]=a
            if v[i]>m:
                m=v[i]
                ind=i
y=ind
a=par[y]
ans=m
m=0
ind=a
vis=[0]*(n+1)
vis[y]=1
while a!=x:
    q=[a]
    while q:
        a1 = q.pop()
        vis[a1]=1
        for i in g[a1]:
            if vis[i] == 0 and i!=par[a1]:
                q.append(i)
                if v[i]-v[a] > m:
                    m = v[i]-v[a]
                    ind = i
    a=par[a]
z=ind
ans+=m
out(ans)
print(x,y,z)