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.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Queue;
public class F615 {
	
	public static int[] prev;
	public static int[] dist;
	
	public static int[] findDiameter(ArrayList<Integer> start, ArrayList<HashSet<Integer>> edges) {
		int N = edges.size();
		boolean[] visited = new boolean[N];
		
		dist = new int[N];
		prev = new int[N];
		
		Arrays.fill(dist, Integer.MAX_VALUE);
		for(int i : start)
			dist[i] = 0;
		
		Queue<Integer> q = new LinkedList<>();
		for(int i : start)
			q.add(i);
		
		while(!q.isEmpty()) {
			int node = q.poll();
			if(visited[node])
				continue;
			visited[node] = true;
			
			for(int j : edges.get(node)) {
				if(!visited[j]) {
					dist[j] = Math.min(dist[node] + 1, dist[j]);
					prev[j] = node;
					q.add(j);
				}
			}
		}
		
		int index = -1;
		int max = -1;
		for(int i = 0; i < N; i++) {
			if(dist[i] > max) {
				index = i;
				max = dist[i];
			}
		}
		
		return new int[]{max, index};
	}

	public static void main(String[] args) {
		FastScanner in = new FastScanner(System.in);
		int N = in.nextInt();
		ArrayList<HashSet<Integer>> edges = new ArrayList<>(N);
		
		for(int i = 0; i < N; i++)
			edges.add(new HashSet<>());
		
		for(int i = 0; i < N-1; i++) {
			int u = in.nextInt() - 1;
			int v = in.nextInt() - 1;
			edges.get(u).add(v);
			edges.get(v).add(u);
		}
		
		ArrayList<Integer> start = new ArrayList<>();
		start.add(0);
		
		int[] temp = findDiameter(start, edges);
		int u = temp[1];
		
		start.clear();
		start.add(u);
		temp = findDiameter(start, edges);
		int v = temp[1];
		
		ArrayList<Integer> diameterPath = new ArrayList<>();
		for(int s = v; s != u; s = prev[s]) {
			diameterPath.add(s);
		}
		diameterPath.add(u);
		
		findDiameter(diameterPath, edges);

		int s = -1;
		int max = -1;
		for(int i = 0; i < N; i++) {
			if(i == u || i == v) continue;
			if(dist[i] > max) {
				s = i;
				max = dist[i];
			}
		}
		
		
		HashSet<Long> set = new HashSet<>();
		for(int i = 0; i < diameterPath.size() - 1; i++) {
			int a = diameterPath.get(i);
			int b = diameterPath.get(i+1);
			
			long c = Math.min(a, b);
			long d = Math.max(a, b);
			set.add(c * N + d);
		}
		
		start.clear();
		start.add(s);
		findDiameter(start, edges);
		
		ArrayList<Integer> uToS = new ArrayList<>();
		for(int i = u; i != s; i = prev[i])
			uToS.add(i);
		uToS.add(s);
		
		ArrayList<Integer> vToS = new ArrayList<>();
		for(int i = v; i != s; i = prev[i])
			vToS.add(i);
		vToS.add(s);
		
		for(int i = 0; i < uToS.size() - 1; i++) {
			int a = uToS.get(i);
			int b = uToS.get(i+1);
			
			long c = Math.min(a, b);
			long d = Math.max(a, b);
			set.add(c * N + d);
		}
		
		for(int i = 0; i < vToS.size() - 1; i++) {
			int a = vToS.get(i);
			int b = vToS.get(i+1);
			
			long c = Math.min(a, b);
			long d = Math.max(a, b);
			set.add(c * N + d);
		}
		
		System.out.println(set.size());
		System.out.println((1+u) + " " + (1+v) + " " + (1+s));
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int chars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
		}

		int read() {
			if (chars == -1)
				throw new InputMismatchException();
			if (curChar >= chars) {
				curChar = 0;
				try {
					chars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (chars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}
/*
8
1 2
2 3
3 4
4 5
4 6
3 7
3 8
outputCopy
5
1 8 6

8
1 2
1 3
1 4
1 5
1 6
1 7
1 8

3
2 3 4
*/