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:
# by the authority of GOD   author: manhar singh sachdev #

import os,sys
from io import BytesIO,IOBase

def main():
    n = int(input())
    path = [[] for _ in range(n)]
    for _ in range(n-1):
        a1,b1 = map(lambda xx:int(xx)-1,input().split())
        path[a1].append(b1)
        path[b1].append(a1)
    st,poi,visi,node,maxi,he = [0],[0]*n,[1]+[0]*(n-1),-1,-1,0
    while len(st):
        x,y = st[-1],path[st[-1]]
        if poi[x] != len(y) and visi[y[poi[x]]]:
            poi[x] += 1
        if poi[x] == len(y):
            st.pop()
            he -= 1
        else:
            he += 1
            i = y[poi[x]]
            if he > maxi:
                node,maxi = i,he
            st.append(i)
            poi[x] += 1
            visi[i] = 1
    length,which = [0]*n,[i for i in range(n)]
    st,poi,visi,node1,maxi,he = [node],[0]*n,[0]*n,-1,-1,0
    visi[node] = 1
    while len(st):
        x,y = st[-1],path[st[-1]]
        if poi[x] != len(y) and visi[y[poi[x]]]:
            poi[x] += 1
        if poi[x] == len(y):
            st.pop()
            he -= 1
            if len(st):
                if length[st[-1]] < length[x]+1:
                    length[st[-1]] = length[x]+1
                    which[st[-1]] = which[x]
        else:
            he += 1
            i = y[poi[x]]
            if he > maxi:
                node1,maxi = i,he
            st.append(i)
            poi[x] += 1
            visi[i] = 1
    st,poi,visi = [node],[0]*n,[0]*n
    visi[node] = 1
    se = [0]*n
    while len(st):
        x,y = st[-1],path[st[-1]]
        if poi[x] != len(y) and visi[y[poi[x]]]:
            poi[x] += 1
        if poi[x] == len(y):
            st.pop()
        else:
            i = y[poi[x]]
            st.append(i)
            if i == node1:
                for j in st:
                    se[j] = 1
                break
            poi[x] += 1
            visi[i] = 1
    if node and node1:
        ind = 0
    elif node != 1 and node1 != 1:
        ind = 1
    else:
        ind = 2
    if maxi == n-1:
        print(maxi)
        print(node+1,node1+1,ind+1)
        exit()
    ma = -1
    for i in range(n):
        if not se[i] and length[i] > ma:
            ma,ind = length[i],which[i]
    print(maxi+ma+1)
    print(node+1,node1+1,ind+1)

# Fast IO Region
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self,file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd,max(os.fstat(self._fd).st_size,BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0,2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd,max(os.fstat(self._fd).st_size,BUFSIZE))
            self.newlines = b.count(b"\n")+(not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0,2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd,self.buffer.getvalue())
            self.buffer.truncate(0),self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self,file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s:self.buffer.write(s.encode("ascii"))
        self.read = lambda:self.buffer.read().decode("ascii")
        self.readline = lambda:self.buffer.readline().decode("ascii")
sys.stdin,sys.stdout = IOWrapper(sys.stdin),IOWrapper(sys.stdout)
input = lambda:sys.stdin.readline().rstrip("\r\n")
if __name__ == "__main__":
    main()