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.*;

public class CF1294F extends PrintWriter {
	CF1294F() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF1294F o = new CF1294F(); o.main(); o.flush();
	}

	int[] oo, oj; int __ = 1;
	int link(int o, int j) {
		oo[__] = o; oj[__] = j;
		return __++;
	}
	int[] ae, d1, d2, d3, c1, c2, c3;
	void init(int n) {
		int m = n - 1;
		oo = new int[1 + m * 2]; oj = new int[1 + m * 2];
		ae = new int[n];
		d1 = new int[n]; d2 = new int[n]; d3 = new int[n];
		c1 = new int[n]; c2 = new int[n]; c3 = new int[n];
	}
	void dfs1(int p, int i) {
		d1[i] = d2[i] = 0;
		c1[i] = c2[i] = i;
		for (int o = ae[i]; o != 0; o = oo[o]) {
			int j = oj[o];
			if (j != p) {
				dfs1(i, j);
				int d = d1[j] + 1, c = c1[j];
				if (d1[i] < d) {
					d3[i] = d2[i]; d2[i] = d1[i]; d1[i] = d;
					c3[i] = c2[i]; c2[i] = c1[i]; c1[i] = c;
				} else if (d2[i] < d) {
					d3[i] = d2[i]; d2[i] = d;
					c3[i] = c2[i]; c2[i] = c;
				} else if (d3[i] < d) {
					d3[i] = d;
					c3[i] = c;
				}
			}
		}
	}
	int ans, a_, b_, c_;
	void dfs2(int p, int i, int d, int c) {
		int sum = d1[i] + d2[i] + Math.max(d3[i], d);
		if (ans < sum) {
			ans = sum;
			a_ = c1[i]; b_ = c2[i]; c_ = d3[i] >= d ? c3[i] : c;
		}
		int d23, d13, d12, c23, c13, c12;
		d23 = d13 = d12 = d;
		c23 = c13 = c12 = c;
		if (d23 < d2[i]) {
			d23 = d2[i];
			c23 = c2[i];
		}
		if (d23 < d3[i]) {
			d23 = d3[i];
			c23 = c3[i];
		}
		if (d13 < d1[i]) {
			d13 = d1[i];
			c13 = c1[i];
		}
		if (d13 < d3[i]) {
			d13 = d3[i];
			c13 = c3[i];
		}
		if (d12 < d1[i]) {
			d12 = d1[i];
			c12 = c1[i];
		}
		if (d12 < d2[i]) {
			d12 = d2[i];
			c12 = c2[i];
		}
		d23++; d13++; d12++;
		for (int o = ae[i]; o != 0; o = oo[o]) {
			int j = oj[o];
			if (j != p) {
				if (c1[j] == c1[i])
					dfs2(i, j, d23, c23);
				else if (c1[j] == c2[i])
					dfs2(i, j, d13, c13);
				else
					dfs2(i, j, d12, c12);
			}
		}
	}
	int distinct(int a, int b) {
		for (int c = 0; c < 3; c++)
			if (a != c && b != c)
				return c;
		return -1;
	}
	void main() {
		int n = sc.nextInt();
		init(n);
		for (int h = 0; h < n - 1; h++) {
			int i = sc.nextInt() - 1;
			int j = sc.nextInt() - 1;
			ae[i] = link(ae[i], j);
			ae[j] = link(ae[j], i);
		}
		dfs1(-1, 0);
		dfs2(-1, 0, 0, 0);
		if (a_ == b_)
			b_ = distinct(a_, c_);
		if (c_ == a_ || c_ == b_)
			c_ = distinct(a_, b_);
		println(ans);
		println((a_ + 1) + " " + (b_ + 1) + " " + (c_ + 1));
	}
}