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 io
import os

from collections import Counter, defaultdict, deque


def longestPathFrom(root, getNbr):
    # BFS
    queue = deque()
    queue.append(root)
    parent = {}
    parent[root] = None
    while queue:
        curr = queue.popleft()
        for child in getNbr(curr):
            if child not in parent:
                queue.append(child)
                parent[child] = curr

    # When loop exits, curr is the last element that was processed. Reconstruct the path
    ret = [curr]
    while curr in parent and parent[curr] is not None:
        curr = parent[curr]
        ret.append(curr)
    return ret[::-1]


def treeDiameter(graph):
    """Returns longest path in the tree"""
    # One end of the diameter has to be the farthest point from an arbitrary node
    # Then finding farthest node from that will give a diameter path of the graph
    initNode = 0

    def getNbr(node):
        return graph[node]

    path1 = longestPathFrom(initNode, getNbr)
    assert path1[0] == initNode
    path2 = longestPathFrom(path1[-1], getNbr)
    return path2


def solve(N, edges):
    graph = [[] for i in range(N)]
    for u, v in edges:
        graph[u].append(v)
        graph[v].append(u)

    path = treeDiameter(graph)
    pathSet = set(path)

    def getNonDiameterNbr(node):
        for nbr in graph[node]:
            if nbr not in pathSet:
                yield nbr

    base = len(path) - 1
    best = (0, path[1])
    for i in range(1, len(path) - 1):
        deepest = longestPathFrom(path[i], getNonDiameterNbr)
        assert deepest[0] == path[i]
        best = max(best, (len(deepest) - 1, deepest[-1]))

    return (
        str(base + best[0])
        + "\n"
        + " ".join(str(x + 1) for x in [path[0], best[1], path[-1]])
    )


if __name__ == "__main__":
    input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

    (N,) = [int(x) for x in input().split()]
    edges = [[int(x) - 1 for x in input().split()] for i in range(N - 1)]
    ans = solve(N, edges)
    print(ans)