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.
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;
public class Cf2 {
    public static int v;
    public static int z = 0;
    public static int[][] dises;
    public static List<Integer>[] graph;
    static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[64]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
    } 
  
    public static void main(String[] args) throws IOException { 
        Reader io = new Reader();
        v = io.nextInt();
        graph = new ArrayList[v+1];
        dises = new int[2][v+1];
        for(int i = 1; i < v+1; i++) graph[i] = new ArrayList<>();
        for(int i = 0; i < v-1; i++) {
            int a = io.nextInt(), b = io.nextInt();
            graph[a].add(b);
            graph[b].add(a);
        }
        boolean[] vis = new boolean[v+1];
        ArrayList<Integer> st = new ArrayList<>();
        int[] t1 = distance(1);
        int[] t2 = distance(t1[1]);
        int v1 = t1[1], v2 = t2[1];
        int diam = t2[0];
        dist(v2);
        kmh(v1, v2, vis, st);
        int s = v1, e = v2;
        vis = null;
        boolean[] diameter = new boolean[v+1];
        st.forEach(a -> diameter[a] = true);
        int max = Integer.MIN_VALUE;
        int maxI = -1;
        for(int i = 1; i <= v; i++) {
            if(diameter[i]) continue;
            int dis1 = dises[0][i];
            int dis2 = dises[1][i];
            int dd = dis1+dis2-diam; dd/=2;
            dd+=diam;
            if(dd > max) {
                max = dd;
                maxI = i;
            }
        }
        System.out.println(max!=Integer.MIN_VALUE ? max : v-1);
        if(maxI != -1)
            System.out.println(v1 + " " + v2 + " " + maxI);
        else
            System.out.println(v1 + " " + v2 + " " + st.get(1));
    }
    public static int[] distance(int s) {
        int[] dis = new int[v+1];
        Arrays.fill(dis, -1);
        dis[s] = 0;
        Queue<Integer> q = new LinkedList<>();
        q.add(s);
        while(!q.isEmpty()) {
            int t = q.poll();
            for(int i = 0; i < graph[t].size(); i++) {
                int k = graph[t].get(i);
                if(dis[k] == -1) {
                    q.add(k);
                    dis[k] = dis[t]+1;
                }
            }
        }
        int maxx = Integer.MIN_VALUE;
        int maxxI = -1;
        for(int i = 1; i <= v; i++)
            if(dis[i] > maxx) {
                maxx = dis[i];
                maxxI = i;
            }
        z++;
        if(z == 2) dises[0] = dis;
        return new int[] {maxx, maxxI};
    }
    public static void dist(int s) {
        int[] dis = new int[v+1];
        Arrays.fill(dis, -1);
        dis[s] = 0;
        Queue<Integer> q = new LinkedList<>();
        q.add(s);
        while(!q.isEmpty()) {
            int t = q.poll();
            for(int i = 0; i < graph[t].size(); i++) {
                int k = graph[t].get(i);
                if(dis[k] == -1) {
                    q.add(k);
                    dis[k] = dis[t]+1;
                }
            }
        }
        dises[1] = dis;
    }
    public static boolean kmh(int s, int e, boolean[] vis, ArrayList<Integer> st) {
        st.add(s);
        vis[s] = true;
        if(s==e) return true;
        List<Integer> nei = graph[s];
        for(int a: nei) {
            if(vis[a]) continue;
            int k = st.size();
            if(kmh(a, e, vis, st)) return true;
        }
        st.remove(st.size()-1);
        return false;
    }
}
