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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class Round615F {

	public static class Pair implements Comparable<Pair>{
		int u;
		int v;
		int distance;
		public Pair(int u,int v,int distance) {
			this.u = u;
			this.v=v;
			this.distance = distance;
		}
		public int compareTo(Pair x) {
			return x.distance-this.distance;
		}
	}
	
	public static LinkedList<Integer>[] adj;
	public static Pair[] dp1;//straight
	public static Pair[] dp2;//current to current
	public static boolean[] visited;

	public static void dfs(int current) {
		visited[current]=true;
		ArrayList<Pair> cu = new ArrayList<Pair>();
		for(Integer x:adj[current]) {
			if(!visited[x]) {
				dfs(x);
				cu.add(dp1[x]);
			}
		}
		if(cu.size()==0) {
			dp1[current]=new Pair(current,current,0);
			dp2[current]=dp1[current];
			return;
		}
		Collections.sort(cu);
		if(cu.size()>0) {
			Pair top = cu.get(0);
			dp1[current]=new Pair(top.u,current,top.distance+1);
		}
		if(cu.size()>1) {
			Pair first = cu.get(0);
			Pair second = cu.get(1);
			dp2[current]=new Pair(first.u,second.u,first.distance+second.distance+2);
		}else {
			dp2[current]=dp1[current];
		}
	}
	
	public static Pair max_distance() {
		int n= adj.length;
		visited=new boolean[n];
		dp1=new Pair[n];
		dp2=new Pair[n];
		dfs(0);
		int max = 0;
		Pair ans = null;
		for(int i=0;i<n;i++) {
			if(max<dp1[i].distance) {
				max= dp1[i].distance;
				ans = dp1[i];
			}
		}
		for(int i=0;i<n;i++) {
			if(max<dp2[i].distance) {
				max= dp2[i].distance;
				ans = dp2[i];
			}
		}
		return ans;
	}
	
	public static ArrayList<Integer> path;
	
	public static boolean dfs_(int src,int des) {
		if(src == des) {
			return true;
		}
		visited[src]=true;
		for(Integer x:adj[src]) {
			if(!visited[x]) {
				if(dfs_(x,des)) {
					path.add(x);
					return true;
				}
			}
		}
		return false;
	}
	
	public static void path_max() {
		Pair max = max_distance();
		int n = adj.length;
		visited= new boolean[n];
		path = new ArrayList<Integer>();
		dfs_(max.u,max.v);
		path.add(max.u);
	}
	
	public static class pair_ implements Comparable<pair_>{
		int distance;
		int name;
		public pair_(int distance,int name) {
			this.distance=distance;
			this.name=name;
		}
		public int compareTo(pair_ x) {
			return this.distance-x.distance;
		}
	}
	
	public static pair_ dfs__(int current,int src) {
		visited[current]=true;
		int max = -1;
		pair_ ans = null;
		for(Integer x:adj[current]) {
			if(!visited[x]) {
				pair_ temp = dfs__(x,src);
				if(max<temp.distance) {
					max = temp.distance;
					ans = new pair_(max+1,temp.name);
				}
			}
		}
		if(ans==null) {
			if(current==src) {
				return ans;
			}else {
				return new pair_(0,current);
			}
		}else {
			return ans;
		}
		
	}
	
	public static void finalans() {
		path_max();
		int n = adj.length;
		visited = new boolean[n];
		for(int i=0;i<path.size();i++) {
			visited[path.get(i)]=true;
		}
		pair_ ans = new pair_(0,path.get(1));
		int max = 0;
		for(int i=0;i<path.size();i++) {
			pair_ curr = dfs__(path.get(i),path.get(i));
			if(curr==null) {
				continue;
			}
			if(max<curr.distance) {
				max = curr.distance;
				ans = curr;
			}
		}
		out.println(path.size()-1+ans.distance);
		out.println((path.get(0)+1)+" "+(path.get(path.size()-1)+1)+" "+(ans.name+1));
	}
	
	public static void solve() {
		int n=s.nextInt();
		adj=new LinkedList[n];
		for(int i=0;i<n;i++) {
			adj[i]=new LinkedList<Integer>();
		}
		for(int i=0;i<n-1;i++) {
			int u = s.nextInt()-1;
			int v=s.nextInt()-1;
			adj[u].add(v);
			adj[v].add(u);
		}
		finalans();
	}

	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		s = new FastReader();
		solve();
		out.close();
	}

	public static FastReader s;
	public static PrintWriter out;

	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	
}