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.*;
import java.util.*;
import java.math.*;
import java.awt.Point;
 
public class Code {
	//static final long MOD = 998244353L;
	//static final long INF = -1000000000000000007L;
	static final long MOD = 1000000007L;
	//static final int INF = 1000000007;
 
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int N = sc.ni();
		ArrayList<Integer>[] tree = new ArrayList[N];
		for (int i = 0; i < N; i++)
			tree[i] = new ArrayList<Integer>();
		for (int i = 0; i < N-1; i++) {
			int u = sc.ni()-1;
			int v = sc.ni()-1;
			tree[u].add(v);
			tree[v].add(u);
		}
		//find the diameter of the tree using BFS.
		int[] dist = new int[N];
		Arrays.fill(dist,Integer.MAX_VALUE);
		ArrayDeque<Integer> bfs = new ArrayDeque<Integer>();
		dist[0] = 0;
		bfs.add(0);
		int A = 0;
		while (!bfs.isEmpty()) {
			int node = bfs.poll();
			for (int neighbor: tree[node]) {
				if (dist[neighbor] == Integer.MAX_VALUE) {
					dist[neighbor] = dist[node]+1;
					bfs.add(neighbor);
					A = neighbor;
				}
			}
		}
		Arrays.fill(dist,Integer.MAX_VALUE);
		dist[A] = 0;
		bfs.add(A);
		int B = A;
		while (!bfs.isEmpty()) {
			int node = bfs.poll();
			for (int neighbor: tree[node]) {
				if (dist[neighbor] == Integer.MAX_VALUE) {
					dist[neighbor] = dist[node]+1;
					bfs.add(neighbor);
					B = neighbor;
				}
			}
		}
		if (dist[B] == N-1) {
			int C = -1;
			for (int i = 0; i < N; i++) {
				if (i != A && i != B) {
					C = i;
					break;
				}
			}
			pw.println(N-1);
			pw.println((A+1) + " " + (B+1) + " " + (C+1));
			pw.close();
			return;
		}
		
		//C is going to be the furthest node away from the diameter AB. Use a multi-node BFS.
		int[] multiDist = new int[N];
		Arrays.fill(multiDist,Integer.MAX_VALUE);
		bfs.add(B);
		int d = dist[B];
		int n = B;
		multiDist[B] = 0;
		while (d > 0) {
			d--;
			for (int neighbor: tree[n]) {
				if (dist[neighbor] == d) {
					n = neighbor;
					break;
				}
			}
			bfs.add(n);
			multiDist[n] = 0;
		}
		int ans = bfs.size()-1;
		int C = B;
		while (! bfs.isEmpty()) {
			int node = bfs.poll();
			for (int neighbor: tree[node]) {
				if (multiDist[neighbor] == Integer.MAX_VALUE) {
					multiDist[neighbor] = multiDist[node]+1;
					bfs.add(neighbor);
					C = neighbor;
				}
			}
		}
		ans += multiDist[C];
		pw.println(ans);
		pw.println((A+1)+" "+(B+1)+" "+(C+1));
		pw.close();
	}
	
	public static long dist(long[] p1, long[] p2) {
		return (Math.abs(p2[0]-p1[0])+Math.abs(p2[1]-p1[1]));
	}
	
	//Find the GCD of two numbers
	public static long gcd(long a, long b) {
		if (a < b) return gcd(b,a);
		if (b == 0)
			return a;
		else
			return gcd(b,a%b);
	}
	
	//Fast exponentiation (x^y mod m)
	public static long power(long x, long y, long m) { 
		long ans = 1;
		x %= m;
		while (y > 0) { 
			if(y % 2 == 1) 
				ans = (ans * x) % m; 
			y /= 2;  
			x = (x * x) % m;
		} 
		return ans; 
	}
	
	public static int[][] shuffle(int[][] array) {
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		return array;
	}
	
    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
 
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  //return arr1[0]-arr2[0]; //ascending order
				  if (arr1[0] != arr2[0]) {
					  return arr1[0]-arr2[0];
				  } else {
					  return arr1[1] - arr2[1];
				  }
	          }
		});
		return array;
	}
    
    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  //return 0;
				  if (arr1[0] < arr2[0]) {
					  return -1;
				  } else if (arr1[1] > arr2[1]) {
					  return 1;
				  } else {
					  return 0;
				  }
	          }
		});
		return array;
	}
    
    static class FastScanner { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int ni() { 
            return Integer.parseInt(next()); 
        } 
  
        long nl() { 
            return Long.parseLong(next()); 
        } 
  
        double nd() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str;
        }
    }
}