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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author El Mehdi ASSALI
 */
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;
    List<Integer>[] adj;
    int[] pars;
    HashSet<Edge> usedEdges = new HashSet<>();

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      n = in.nextInt();
      adj = new List[n + 1];
      for (int i = 1; i <= n; i++) {
        adj[i] = new ArrayList<>();
      }
      for (int i = 1; i <= n - 1; i++) {
        int u = in.nextInt(), v = in.nextInt();
        adj[u].add(v);
        adj[v].add(u);
      }
      pars = new int[n + 1];
      int[] a = dfs(1, 0);
//    chosen.add(a[0]);
      int[] b = dfs(a[0], 0);
//    chosen.add(b[0]);
      int u = b[0];
      int answer = 0;
      while (u != a[0]) {
        answer++;
        usedEdges.add(new Edge(u, pars[u]));
        u = pars[u];
      }
      if (answer == n - 1) {
        int c = -1;
        for (int i = 1; i <= n; i++) {
          if (i != a[0] && i != b[0]) {
            c = i;
            break;
          }
        }
        out.println(answer);
        out.println(a[0] + " " + b[0] + " " + c);
      } else {
        int[] c = getDepths(a[0], 0);
        answer += c[1];
        out.println(answer);
        out.println(a[0] + " " + b[0] + " " + c[0]);
      }
    }

    int[] getDepths(int cur, int par) {
      int[] answer = {cur, 0};
      for (int to : adj[cur]) {
        if (to != par) {
          int[] furthest = getDepths(to, cur);
          if ((usedEdges.contains(new Edge(cur, to)) ? 0 : 1) + furthest[1] > answer[1]) {
            answer = new int[]{furthest[0], (usedEdges.contains(new Edge(cur, to)) ? 0 : 1) + furthest[1]};
          }
        }
      }
      return answer;
    }

    int[] dfs(int cur, int par) {
      pars[cur] = par;
      int[] answer = {cur, 0};
      for (int to : adj[cur]) {
        if (to != par) {
          int[] furthest = dfs(to, cur);
          if (furthest[1] + 1 > answer[1]) {
            answer = new int[]{furthest[0], furthest[1] + 1};
          }
        }
      }
      return answer;
    }

    class Edge {
      int u;
      int v;

      Edge(int u, int v) {
        this.u = Math.min(u, v);
        this.v = Math.max(u, v);
      }

      public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Edge edge = (Edge) o;
        return u == edge.u &&
          v == edge.v;
      }

      public int hashCode() {
        return Objects.hash(u, v);
      }

    }

  }

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

    public InputReader(InputStream inputStream) {
      reader = new BufferedReader(new InputStreamReader(inputStream));
    }

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

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

  }
}

