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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.util.TreeSet;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Indrajit Sinha
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		FThreePathsOnATree solver = new FThreePathsOnATree();
		solver.solve(1, in, out);
		out.close();
	}

	static class FThreePathsOnATree {
		int n;
		ArrayList<Integer>[] tree;
		boolean[] vis;
		PrintWriter out;
		InputReader in;
		int[] par;
		int[] height;
		int mx = 0;
		int ind = -1;
		TreeSet<Integer> ts;

		void setd(int x, int p, int h) {
			par[x] = p;
			height[x] = h;
			for (Integer it : tree[x]) {
				if (it != p)
					setd(it, x, h + 1);
				;
			}
		}

		int diam(int x) {
			setd(x, x, 0);
			int mx = 0;
			int ind = 0;
			for (int i = 0; i < n; i++) {
				if (height[i] > mx) {
					mx = height[i];
					ind = i;
				}
			}
			return ind;
		}

		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int t, i, j, tt, k;
			this.out = out;
			this.in = in;
			n = in.nextInt();
			initT(n);
			par = new int[n];
			height = new int[n];
			for (i = 0; i < n - 1; i++) {
				int x = in.nextInt() - 1;
				int y = in.nextInt() - 1;
				tree[x].add(y);
				tree[y].add(x);
			}

			int b = diam(diam(0));
			int a = diam(b);
			ts = new TreeSet<>();
			int x = a;
			while (x != b) {
				ts.add(x);
				x = par[x];
			}
			ts.add(b);

			Arrays.fill(vis, false);
			mx = 0;
			ind = -1;
			findfs(a, 0, 0);
			if (ind == -1) {
				for (Integer it : ts) {
					if (it != a && it != b) {
						ind = it;
						break;
					}
				}
			}
			pn(mx + ts.size() - 1);
			pn((a + 1) + " " + (b + 1) + " " + (ind + 1));
		}

		void findfs(int x, int y, int ht) {
			vis[x] = true;
			if (!ts.contains(x)) {
				int oo = ht - y;
				if (mx <= oo) {
					mx = oo;
					ind = x;
				}
			}
			for (Integer it : tree[x]) {
				if (!vis[it]) {
					if (ts.contains(x))
						findfs(it, ht, ht + 1);
					else
						findfs(it, y, ht + 1);
				}
			}
		}

		void pn(int zx) {
			out.println(zx);
		}

		void pn(String zx) {
			out.println(zx);
		}

		void initT(int n) {
			vis = new boolean[n];
			tree = new ArrayList[n];
			for (int i = 0; i < n; i++) {
				tree[i] = new ArrayList<>();
			}
		}

	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

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

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

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

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

			return res.toString();
		}

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

	}
}