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.*;
import java.util.*;

public class Main {
  static BufferedReader reader;
  static StringTokenizer stoken;
  static PrintWriter out;

  static int ni() throws Exception {
    return Integer.parseInt(ns());
  }

  static long nl() throws Exception {
    return Long.parseLong(ns());
  }

  static double nd() throws Exception {
    return Double.parseDouble(ns());
  }

  static String ns() throws Exception {
    if (stoken == null || !stoken.hasMoreTokens()) stoken = new StringTokenizer(reader.readLine());
    return stoken.nextToken();
  }

  static ArrayList<ArrayList<Integer>> edges;
  static ArrayList<ArrayList<Point>> child;
  static ArrayList<ArrayList<Point>> uschild;
  static int[] res;
  static int ans;

  public static void main(String[] args) throws Exception {
    reader = new BufferedReader(new InputStreamReader(System.in));
    out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), true);

    int n = ni();
    edges = new ArrayList<ArrayList<Integer>>();
    child = new ArrayList<ArrayList<Point>>();
    uschild = new ArrayList<ArrayList<Point>>();
    res = new int[3];
    ans = 0;
    for (int i = 0; i < n; i++) {
      edges.add(new ArrayList<Integer>());
      child.add(new ArrayList<Point>());
      uschild.add(new ArrayList<Point>());
    }

    for (int i = 0; i < n - 1; i++) {
      int a = ni(), b = ni();
      --a; --b;
      edges.get(a).add(b);
      edges.get(b).add(a);
    }

    gdown(0, -1);
    gup(0, -1, new Point(0, 0));

    out.println(ans);
    for (int i = 0; i < 3; i++) out.print(res[i] + 1 + " ");
    out.println();
  }

  static void gup(int v, int par, Point pass) {
    int sz = child.get(v).size();
    Point[] pmax = new Point[sz];
    Point[] smax = new Point[sz];

    Point best = new Point(0, 0);
    for (int i = 0; i < sz; i++) {
      best = max(best, uschild.get(v).get(i));
      pmax[i] = best;
    }
    best = new Point(0, 0);
    for (int i = sz - 1; i >= 0; i--) {
      best = max(best, uschild.get(v).get(i));
      smax[i] = best;
    }

    // out.println(v + " " + pass);
    // for (Point x: child.get(v)) out.print(x + " ");
    // out.println();

    if (v != 0) {
      if (sz == 1) {
        int a = child.get(v).get(0).x + pass.x;
        if (a > ans) {
          ans = a;
          res[0] = v;
          res[1] = pass.y;
          res[2] = child.get(v).get(0).y;
        }
      } else if (sz > 1) {
        int a = child.get(v).get(sz - 1).x + child.get(v).get(sz - 2).x + pass.x;
        if (a > ans) {
          ans = a;
          res[0] = child.get(v).get(sz - 2).y;
          res[1] = pass.y;
          res[2] = child.get(v).get(sz - 1).y;
        }

        if (sz > 2) {
          a = child.get(v).get(sz - 1).x + child.get(v).get(sz - 2).x + child.get(v).get(sz - 3).x;
          if (a > ans) {
            ans = a;
            res[0] = child.get(v).get(sz - 2).y;
            res[1] = child.get(v).get(sz - 3).y;
            res[2] = child.get(v).get(sz - 1).y;
          }
        }
      }
    } else {
      if (sz == 2) {
        int a = child.get(v).get(sz - 1).x + child.get(v).get(sz - 2).x;
        if (a > ans) {
          ans = a;
          res[0] = child.get(v).get(sz - 2).y;
          res[1] = v;
          res[2] = child.get(v).get(sz - 1).y;
        }
      } else if (sz > 2) {
        int a = child.get(v).get(sz - 1).x + child.get(v).get(sz - 2).x + child.get(v).get(sz - 3).x;
        if (a > ans) {
          ans = a;
          res[0] = child.get(v).get(sz - 2).y;
          res[1] = child.get(v).get(sz - 3).y;
          res[2] = child.get(v).get(sz - 1).y;
        }
      }
    }

    int c = 0;
    for (int i = 0; i < edges.get(v).size(); i++) {
      if (edges.get(v).get(i) != par) {
        Point b = new Point(pass.x, pass.y);
        if (c > 0) b = max(b, pmax[c - 1]);
        if (c < sz - 1) b = max(b, smax[c + 1]);
        gup(edges.get(v).get(i), v, new Point(b.x + 1, b.y));
        ++c;
      }
    }
  }

  static Point gdown(int v, int par) {
    Point best = new Point(0, v);
    for (int i = 0; i < edges.get(v).size(); i++) {
      if (edges.get(v).get(i) != par) {
        int x = edges.get(v).get(i);
        Point nx = gdown(x, v);
        child.get(v).add(nx);
        best = max(best, nx);
      }
    }

    for (Point x: child.get(v)) uschild.get(v).add(x);

    Collections.sort(child.get(v));

    // out.println(v);
    // for (Point x: child.get(v)) out.print(x + " ");
    // out.println();

    ++best.x;
    return best;
  }

  static Point max(Point a, Point b) {
    if (a.x == b.x) {
      if (a.y < b.y) return new Point(b.x, b.y);
      return new Point(a.x, a.y);
    }
    if (a.x < b.x) return new Point(b.x, b.y);
    return new Point(a.x, a.y);
  }

  static class Point implements Comparable<Point> {
    public int x;
    public int y;

    Point() {}
    Point(int a, int b) {x = a; y = b;}

    public int compareTo(Point other) {
      if (x == other.x) return y - other.y;
      return x - other.x;
    }

    public String toString() {
      return "(" + x + ", " + y + ")";
    }
  }
}