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:
/*
javac f.java && java f
*/

import java.io.*;
import java.util.*;

public class f {
	public static void main(String[] args) { new f(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);

	int n, leaf, ans;
	int[] x, par, guy, depth, endpt;
	ArrayDeque<Integer> q;
	ArrayList<Integer>[] adj;

	f() {
		n = in.nextInt();
		adj = new ArrayList[n];
		for (int i = 0; i < n; i++) 
			adj[i] = new ArrayList<>();
		for (int i = 0; i < n - 1; i++) {
			int u = in.nextInt() - 1;
			int v = in.nextInt() - 1;
			adj[u].add(v);
			adj[v].add(u);
		}
		endpt = new int[3];
		par = new int[n];
		depth = new int[n];

		leaf = 0;
		for (; leaf < n; leaf++) 
			if (adj[leaf].size() == 1) 
				break;
		x = bfs(leaf, false, true);
		endpt[0] = x[1];
		x = bfs(endpt[0], false, true);
		endpt[1] = x[1];
		ans = x[0];
		if (ans == n - 1) {
			out.println(ans);
			for (; endpt[2] < n; endpt[2]++)
				if (endpt[2] != endpt[0] && endpt[2] != endpt[1])
					break;
			out.printf("%d %d %d%n", ++endpt[0], ++endpt[1], ++endpt[2]);
			out.close();
			return;
		}

		guy = new int[n];
		int pt = endpt[1], dp = 0;
		while (pt != endpt[0]) {
			guy[par[pt]] = pt;
			x = bfs(par[pt], true, false);
			if (x[0] > dp) {
				dp = x[0];
				endpt[2] = x[1];
			}
			pt = par[pt];
		}
		
		ans += dp;
		out.println(ans);
		out.printf("%d %d %d%n", ++endpt[0], ++endpt[1], ++endpt[2]);
		out.close();
	}

	int[] bfs(int st, boolean bad, boolean set) {
		int[] mx = new int[2];
		q = new ArrayDeque<>();		
		q.add(st); q.add(0);
		if (set) par[st] = st;
		while (q.size() > 0) {
			int node = q.poll();
			int d = q.poll(); d++;
			for (int ch : adj[node]) {
				if (ch == par[node]) continue;
				if (bad && node == st && ch == guy[node]) continue;
				if (set) {
					par[ch] = node;
					depth[ch] = d;
				}
				q.add(ch); q.add(d);
				if (d > mx[0]) {
					mx[0] = d;
					mx[1] = ch;
				}
			}
		}
		return mx;
	}
	
	int abs(int x) { if (x < 0) return -x; return x; }
	long abs(long x) { if (x < 0) return -x; return x; }
	int min(int a, int b) { if (a < b) return a; return b; }	
	int max(int a, int b) { if (a > b) return a; return b; }	
	long min(long a, long b) { if (a < b) return a; return b; }	
	long max(long a, long b) { if (a > b) return a; return b; }	
	int gcd(int a, int b) { while (b > 0) { a = b^(a^(b = a)); b %= a; } return a; }
	long gcd(long a, long b) { while (b > 0) { a = b^(a^(b = a)); b %= a; } return a; }
	long lcm(int a, int b) { return (((long) a) * b) / gcd(a, b); }
	long lcm(long a, long b) { return (a * b) / gcd(a, b); }

	void sort(int[] arr) {
		int sz = arr.length, j;
		Random r = new Random();
		for (int i = 0; i < sz; i++) {
			j = r.nextInt(i + 1);
			arr[i] = arr[j]^(arr[i]^(arr[j] = arr[i]));
		} Arrays.sort(arr);
	}

	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}