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 JAVA):

Solution:
// package Quarantine;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class ThreePathsOnATree {
    static ArrayList<Integer> tree[];
    static boolean visited[];
    public static void main(String[] args)throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        tree=new ArrayList[n+1];
        visited=new boolean[n+1];
        for(int i=1;i<=n;i++){
            tree[i]=new ArrayList<>();
        }
        for(int i=1;i<n;i++){
            StringTokenizer st=new StringTokenizer(br.readLine());
            int u=Integer.parseInt(st.nextToken());
            int v=Integer.parseInt(st.nextToken());
            tree[u].add(v);
            tree[v].add(u);
        }
        int ans[]=diameter(1);
//        printarr(ans);
        ArrayList<Integer> d=new ArrayList<>();
        Queue<Integer> queue=new LinkedList<>();
        int s=ans[2];
        int e=ans[3];
        queue.add(s);
//        System.out.println(s+" "+e);
        visited=new boolean[n+1];
        visited[s]=true;
        int par[]=new int[n+1];
        par[s]=-1;
        while(!queue.isEmpty()){
            int curr=queue.remove();
//            System.out.println(curr);
            for(int j:tree[curr]){
                if(!visited[j]){
                    visited[j]=true;
                    queue.add(j);
                    par[j]=curr;
                }
            }
        }
        int v=e;
//        System.out.println("eee");
        while(v!=-1){
//            System.out.println(v);
            d.add(v);
            v=par[v];
        }
//        System.out.println("fff");
        int len=d.size()-1;
        queue=new LinkedList<>();
        visited=new boolean[n+1];
        int dep[]=new int[n+1];
        for(int ve:d){
            queue.add(ve);
            visited[ve]=true;
        }
        while(!queue.isEmpty()){
            int curr=queue.remove();
            for(int j:tree[curr]){
                if(!visited[j]){
                    visited[j]=true;
                    queue.add(j);
//                    System.out.println(j);
                    dep[j]=dep[curr]+1;
                }
            }
        }
        int max=-1;
        int third=-1;
        for(int i=1;i<=n;i++){
            if(i==s||i==e){
                continue;
            }
            if(dep[i]>max){
                max=dep[i];
                third=i;
            }
        }
        System.out.println(len+dep[third]);
        System.out.println(s+" "+e+" "+third);
    }
    public static int[] diameter(int curr){
        visited[curr]=true;
        int ans[]=new int[5];//maxd,node,l,r,ans
        int l1=0,l2=0,l=-1,r=-1;
        int maxd=0,node=-1;
        int maxans=0,maxl=-1,maxr=-1;
        for(int j:tree[curr]){
            if(!visited[j]){
                int small[]=diameter(j);
                if(small[0]+1>maxd){
                    maxd=small[0]+1;
                    node=small[1];
                }
                if(small[0]+1>l1){
                    l2=l1;
                    r=l;
                    l1=small[0]+1;
                    l=small[1];
                }
                else if(small[0]+1>l2){
                    l2=small[0]+1;
                    r=small[1];
                }
                if(small[4]>maxans){
                    maxans=small[4];
                    maxl=small[2];
                    maxr=small[3];
                }
            }
        }
        int op1=l1+l2;
        int op2=maxans;
        int max=Math.max(op1,op2);
        if(max==0){
            ans[1]=curr;
            ans[2]=-1;
            ans[3]=-1;
            ans[4]=-1;
            return ans;
        }
        if(op1>maxans){
            ans[0]=maxd;
            ans[1]=node;
            if(l2==0){
                ans[2]=node;
                ans[3]=curr;
                ans[4]=l1;
            }
            else{
                ans[2]=l;
                ans[3]=r;
                ans[4]=l1+l2;
            }
            return ans;
        }
        else{
            ans[0]=maxd;
            ans[1]=node;
            ans[2]=maxl;
            ans[3]=maxr;
            ans[4]=maxans;
            return ans;
        }
    }
    public static void printarr(int a[]){
        for(int i=0;i<a.length;i++){
            System.out.print(a[i]+" ");
        }
        System.out.println();
    }
}