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,itertools
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right 
from heapq import heappop,heappush,heapify, nlargest
from copy import deepcopy
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_1(): return list(map(lambda x:int(x)-1, sys.stdin.readline().split()))
def inps(): return sys.stdin.readline()
def inpsl(x): tmp = sys.stdin.readline(); return list(tmp[:x])
def err(x): print(x); exit()
 
LV = 21
def construct(prv):
    kprv = [prv]
    S = prv
    for k in range(20):
        T = [-1]*n
        for i in range(n):
            if S[i] == -1:
                continue
            T[i] = S[S[i]]
        kprv.append(T)
        S = T
    return kprv

def lca(u, v, kprv, depth):
    dd = depth[v] - depth[u]
    if dd < 0:
        u, v = v, u
        dd = -dd

    # assert depth[u] <= depth[v]
    for k in range(LV+1):
        if dd & 1:
            v = kprv[k][v]
        dd >>= 1

    # assert depth[u] == depth[v]
    if u == v:
        return u

    for k in range(LV-1, -1, -1):
        pu = kprv[k][u]; pv = kprv[k][v]
        if pu != pv:
            u = pu; v = pv

    # assert kprv[0][u] == kprv[0][v]
    return kprv[0][u]


n = inp()
ab = [inpl_1() for _ in range(n-1)]
g = [[] for _ in range(n)]
for a,b in ab: 
    g[a].append(b)
    g[b].append(a)
pa = [-1]*n
def bfs(s):
    q = deque([s]); depth = [-1]*n; depth[s] = 0
    while q:
        v = q.popleft()
        for u in g[v]:
            if depth[u] == -1:
                depth[u] = depth[v]+1
                pa[u] = v
                q.append(u)
    return depth

depth = bfs(0)
mx = -1; root = -1
for i,x in enumerate(depth):
    if x > mx: mx = x; root = i
depth = bfs(root)
mx = -1; B = -1
for i,x in enumerate(depth):
    if x > mx: mx = x; B = i

res = -1; C = -1
# pa[v] ->vの親ノード
#kprv[k][v] -> vから2^k回上に遡った時の頂点
kprv = construct(pa)
#dist[v] -> ルートからの深さ
#l -> a,bのLCA
for i in range(n):
    if i == B or i == root: continue
    l = lca(i,B,kprv,depth)
    ans = depth[i] - depth[l]
    if ans > res:
        C = i
        res = ans
print(res+mx)
print(root+1,B+1,C+1)