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.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class ThreePathsOnATree implements Closeable {

  private InputReader in = new InputReader(System.in);
  private PrintWriter out = new PrintWriter(System.out);

  public void solve() {
    n = in.ni();
    for (int i = 0; i < n; i++) {
      tree.add(new ArrayList<>());
    }
    for (int i = 0; i < n - 1; i++) {
      int u = in.ni() - 1, v = in.ni() - 1;
      tree.get(u).add(v);
      tree.get(v).add(u);
    }
    bfs1();
    List<Integer> sources = bfs2(nodes[0]);
    diameter += bfs3(sources);
    out.println(diameter);
    for (int i = 0; i < 3; i++) {
      out.print(nodes[i] + 1);
      out.print(' ');
    }
  }

  private int n, diameter;
  private List<List<Integer>> tree = new ArrayList<>();
  private int[] nodes = new int[3];

  private void bfs1() {
    int[] dist = new int[n];
    dist[0] = 0;
    boolean[] visited = new boolean[n];
    ArrayDeque<Integer> queue = new ArrayDeque<>();
    queue.add(0);
    visited[0] = true;
    while (queue.size() > 0) {
      int top = queue.poll();
      for (int next : tree.get(top)) {
        if (!visited[next]) {
          dist[next] = dist[top] + 1;
          visited[next] = true;
          queue.add(next);
        }
      }
    }
    int max = 0;
    for (int i = 0; i < n; i++) {
      if (dist[i] > max) {
        nodes[0] = i;
        max = dist[i];
      }
    }
  }

  private List<Integer> bfs2(int start) {
    int[] dist = new int[n];
    dist[start] = 0;
    boolean[] visited = new boolean[n];
    ArrayDeque<Integer> queue = new ArrayDeque<>();
    queue.add(start);
    visited[start] = true;
    int[] parent = new int[n];
    parent[start] = -1;
    while (queue.size() > 0) {
      int top = queue.poll();
      for (int next : tree.get(top)) {
        if (!visited[next]) {
          dist[next] = dist[top] + 1;
          visited[next] = true;
          queue.add(next);
          parent[next] = top;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (dist[i] > diameter) {
        nodes[1] = i;
        diameter = dist[i];
      }
    }
    List<Integer> sources = new ArrayList<>();
    int current = nodes[1];
    do {
      sources.add(current);
      current = parent[current];
    } while (current != -1);
    return sources;
  }

  private int bfs3(List<Integer> sources) {
    int[] dist = new int[n];
    boolean[] visited = new boolean[n];
    for (int source : sources) {
      dist[source] = 0;
      visited[source] = true;
    }
    ArrayDeque<Integer> queue = new ArrayDeque<>(sources);
    while (queue.size() > 0) {
      int top = queue.poll();
      for (int next : tree.get(top)) {
        if (!visited[next]) {
          dist[next] = dist[top] + 1;
          visited[next] = true;
          queue.add(next);
        }
      }
    }
    int max = 0;
    for (int i = 0; i < n; i++) {
      if (dist[i] > max) {
        nodes[2] = i;
        max = dist[i];
      }
    }
    if (nodes[2] == 0) {
      for (int i = 0; i < n; i++) {
        if (i != nodes[0] && i != nodes[1]) {
          nodes[2] = i;
          break;
        }
      }
    }
    return max;
  }

  @Override
  public void close() throws IOException {
    in.close();
    out.close();
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

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

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

    public void close() throws IOException {
      reader.close();
    }
  }

  public static void main(String[] args) throws IOException {
    try (ThreePathsOnATree instance = new ThreePathsOnATree()) {
      instance.solve();
    }
  }
}