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:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class d extends PrintWriter{
    static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
    // static Scanner s=new Scanner(System.in);
    d() { super(System.out); }
    public static void main(String[] args) throws IOException{
        d d1=new d();d1.main();d1.flush();
    }void main() throws IOException {
        StringBuilder sb = new StringBuilder();
        PrintWriter out = new PrintWriter(System.out);
         String[] s1=s();
         int n=i(s1[0]);
        ArrayList<Integer>[] adj=new ArrayList[n+1];
        int[] vis=new int[n+1];
        for(int i=0;i<n-1;i++){
            String[] s3=s();int u=i(s3[0]);int v=i(s3[1]);
            if(adj[u]==null) adj[u]=new ArrayList<>();
            if(adj[v]==null) adj[v]=new ArrayList<>();
            adj[u].add(v);adj[v].add(u);
        }ft=0;
        bfs(1,n,adj,vis);vis=new int[n+1];
        int ft1=ft;ans=-1;
     //   System.out.println(adj[2].get(1));
        bfs(ft,n,adj,vis);
        int ft2=ft;
        int fans=vis[ft2]-1;
        vis=new int[n+1];
        dfs(ft,ft1,adj,vis);
        int max=0;int ft3=0;
        for(int i=1;i<=n;i++){
            if(vis[i]==1){
                bfs(i,n,adj,vis);
                if(vis[ft]>max){
                    max=vis[ft]-1;ft3=ft;
                }
            }
        }
        int an=0;
        if(max==0){
        for(int i=1;i<=n;i++){
            if(i!=ft1&&i!=ft2){
                ft3=i;break;
            }
        }}
        System.out.println(fans+max);
        System.out.println(ft1+" "+ft2+" "+ft3);
//        System.out.println(vis[6]+" "+vis[4]+" "+vis[2]+" "+vis[1]);
//        System.out.println(vis[ft]);
//        System.out.println(ft1+" "+ft+" "+an);
    }
      static int ft;static int ans;
    static boolean dfs(int i,int des,ArrayList<Integer> [] adj,int [] vis){
        vis[i]=1;
        if(i==des) return true;
        if(adj[i]==null) return false;
        for(Integer j:adj[i]){
            if(vis[j]==0){
                if(dfs(j,des,adj,vis)==true) return true;
            }
        }vis[i]=0;
        return false;
    }
      static void bfs(int i,int n,ArrayList<Integer> [] adj,int [] vis){
        //int[] vis=new int[n+1];
        Queue<Integer> q=new LinkedList<>();
        q.add(i);vis[i]=1;
        while(!q.isEmpty()){
             i=q.poll();

            ft=i;
            for(Integer j:adj[i]){
                if(vis[j]==0){
                    q.add(j);vis[j]=vis[i]+1;
                }
            }
        }
    }
    static String[] s() throws IOException {

        return s.readLine().trim().split("\\s+");
    }

    static int i(String ss) {
        return Integer.parseInt(ss);
    }
    static long l(String ss) {
        return Long.parseLong(ss);
    }
}
class node implements Comparator<node>{
    int ver,val;
    public node(){}
    public node(int ver,int val) {
        this.ver=ver;this.val=val;
    }public int compare(node n1,node n2){
       return n1.val-n2.val;
    }
}

class Student12 {
    int  l;long r;
    public Student12(int l, long r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll12 implements Comparator<Student12> {

    public int compare(Student12 a, Student12 b){
        if(a.r<b.r) return 1;else if(a.r==b.r) return 0;else return -1;// a.r-b.r;
      /*  if(b.r<a.r) return -1;
        else if(b.r==a.r) return 0;
        return 1;*/

        //   return b.r-a.r;
       /*
       if(b.l<a.l) return -1;
       else if(b.l==a.l) {
           return b.r-a.r;
       }
       return 1;*/
        //        return b.r- a.r;
        //        return (int) a.l-(int) b.l;
         /*   if(a.r<b.r) return -1;
            else if(a.r==b.r){
                if(a.r==b.r){
                    return 0;
                }
                if(a.r<b.r) return -1;
                return 1;}
            return 1;  */}
}
class Node1 implements Comparator<Node1>{
    int node;long val;
    public  Node1(){}
    public  Node1(int node,long val){
        this.node=node;this.val=val;
    }
    @Override
    public int compare(Node1 a,Node1 b){
        if(a.val<b.val) return -1;
        if(a.val==b.val) return 0;
        {
            return 1;
        }
    }
}