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.
from collections import deque
from types import GeneratorType
def bootstrap(f, stack=[]):
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
    return wrappedfunc

def main():
    
    # Find 2 points that give the tree diameter (furthest away).
    # Root the tree.
    # Try all other leaves, finding additional dist via BFS.
    
    n=int(input())
    adj=[[] for _ in range(n+1)]
    for _ in range(n-1):
        u,v=readIntArr()
        adj[v].append(u)
        adj[u].append(v)
    leaves=[]
    for node in range(1,n+1):
        if len(adj[node])==1:
            leaves.append(node)
    
    if len(leaves)==2: # one long chain
        node1=leaves[0]
        node2=leaves[1]
        for node in range(1,node+1):
            if node!=node1 and node!=node2:
                node3=node
                break
        print(n-1)
        print('{} {} {}'.format(node1,node2,node3))
        return None
    
    visited=[False for _ in range(n+1)]
    visited[leaves[0]]=True
    dfs=[[leaves[0],0]] # node,depth
    farNode1=None
    maxDepth=0
    while dfs:
        node,d=dfs.pop()
        if d>maxDepth:
            maxDepth=d
            farNode1=node
        for nex in adj[node]:
            if not visited[nex]:
                visited[nex]=True
                dfs.append([nex,d+1])
    visited=[False for _ in range(n+1)]
    visited[farNode1]=True
    dfs=[[farNode1,0]] # node,depth
    farNode2=None
    maxDepth=0
    while dfs:
        node,d=dfs.pop()
        if d>maxDepth:
            maxDepth=d
            farNode2=node
        for nex in adj[node]:
            if not visited[nex]:
                visited[nex]=True
                dfs.append([nex,d+1])
    
    dist1_2=maxDepth # number of edges from farNode1 and farNode2
    
    @bootstrap
    def dfs(node):
        if node==farNode2:
            yield True
        for nex in adj[node]:
            if len(path1_2Nodes)<2 or path1_2Nodes[-2]!=nex: # not parent
                path1_2Nodes.append(nex)
                if (yield dfs(nex)):
                    yield True
                path1_2Nodes.pop()
        yield False
    path1_2Nodes=[farNode1]
    dfs(farNode1)
    
    q=deque() #[node, dist]
    distFromPath=[-inf for _ in range(n+1)]
    for node in path1_2Nodes:
        q.append([node,0])
        distFromPath[node]=0
    while q:
        node,d=q.popleft()
        for nex in adj[node]:
            if distFromPath[nex]==-inf: # unvisited
                distFromPath[nex]=d+1
                q.append([nex,d+1])
    
    maxDistFromPath=-1
    farNode3=0
    for node in range(1,n+1):
        if distFromPath[node]>maxDistFromPath:
            maxDistFromPath=distFromPath[node]
            farNode3=node
    print(maxDistFromPath+dist1_2)
    print('{} {} {}'.format(farNode1,farNode2,farNode3))
    
    return
    
import sys
input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
# import sys
# input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.
 
def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))
 
def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]
 
def makeArr(*args):
    """
    *args : (default value, dimension 1, dimension 2,...)
    
    Returns : arr[dim1][dim2]... filled with default value
    """
    assert len(args) >= 2, "makeArr args should be (default value, dimension 1, dimension 2,..."
    if len(args) == 2:
        return [args[0] for _ in range(args[1])]
    else:
        return [makeArr(args[0],*args[2:]) for _ in range(args[1])]
 
def queryInteractive(x,y):
    print('? {} {}'.format(x,y))
    sys.stdout.flush()
    return int(input())
 
def answerInteractive(ans):
    print('! {}'.format(ans))
    sys.stdout.flush()
 
inf=float('inf')
MOD=10**9+7
 
for _abc in range(1):
    main()