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:
from __future__ import division, print_function
import bisect
import math
import itertools
import sys
from atexit import register
 
if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream
 
 
if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)
 
        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)
 
        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)
 
    input = raw_input
    range = xrange
 
    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip
 
 
def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.
 
    Args:
        sync (bool, optional): The new synchronization setting.
 
    """
    global input, flush
 
    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')
 
        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))
 
def main():

 
    def bfs(root,n,g,dist):
        
        dist[root]=0
        q=[root]
        it=-1
        #print(q,dist)
        m=0
        l=root
        while(it<len(q)-1):
            it+=1
            p=q[it]
            for i in range(len(g[p])):
                if dist[g[p][i]]==-1:
                    q.append(g[p][i])
                    dist[g[p][i]]=dist[p]+1
                    if dist[g[p][i]]>m:
                        m=dist[g[p][i]]
                        l=g[p][i]
        return l,m
            
    
    def parentbfs(root,n,g):
        parent=[-1]*n
        q=[root]
        it=-1
        while(it<len(q)-1):
            it+=1
            p=q[it]
            for i in range(len(g[p])):
                if parent[g[p][i]]==-1 and g[p][i]!=root:
                    q.append(g[p][i])
                    parent[g[p][i]]=p
        return parent
    n=int(input())    
    g=[]
    for i in range(n):
        g.append([])
    ll=0    
    for i in range(n-1):
        x,y=map(int,input().split())
        g[x-1].append(y-1)
        g[y-1].append(x-1)  
    
    #print(parent)
    dist=[-1]*(n)
    x,te=bfs(0,n,g,dist)  
    dist=[-1]*(n)
    y,te=bfs(x,n,g,dist)
    parent=parentbfs(y,n,g)
    pxy=[x]
    t=x
    while(parent[t]!=-1):
        
        pxy.append(parent[t])
        t=parent[t]
    #print(pxy)
    '''q=-1
    while(px[q]==py[q]):
        q-=1
        if abs(q)>min(len(px),len(py)):
            break
        
    q=abs(q)    
    px=px[:len(px)-q+1]
    py=py[:len(py)-q+2]
    py.reverse()
    pxy=px+py'''
    #
    
    if len(pxy)==n:
        print(n-1)
        ans=[]
        for i in range(n):
            ans.append([len(g[i]),i+1])
        ans.sort()
        print(ans[0][1],ans[1][1],ans[2][1])
    else:
        distance=[-1]*(n)
        for i in pxy:
            distance[i]=0
        w=0    
        for i in range(1,len(pxy)-1):
            if len(g[pxy[i]])<=2:
                continue
            xx,yy=bfs(pxy[i],n,g,distance)
            if yy>=w:
                t,w=xx,yy
        
        print(len(pxy)+w-1)
        print(x+1,y+1,t+1)

if __name__ == '__main__':
    sync_with_stdio(False)
    main()