Problem: There are n distinct points on a coordinate line, the coordinate of i-th point equals to x_i. Choose a subset of the given set of points such that the distance between each pair of points in a subset is an integral power of two. It is necessary to consider each pair of points, not only adjacent. Note that any subset containing one element satisfies the condition above. Among all these subsets, choose a subset with maximum possible size.

In other words, you have to choose the maximum possible number of points x_{i_1}, x_{i_2}, ..., x_{i_m} such that for each pair x_{i_j}, x_{i_k} it is true that |x_{i_j} - x_{i_k}| = 2^d where d is some non-negative integer number (not necessarily the same for each pair of points).

Input

The first line contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of points.

The second line contains n pairwise distinct integers x_1, x_2, ..., x_n (-10^9 ≤ x_i ≤ 10^9) — the coordinates of points.

Output

In the first line print m — the maximum possible number of points in a subset that satisfies the conditions described above.

In the second line print m integers — the coordinates of points in the subset you have chosen.

If there are multiple answers, print any of them.

Examples

Input

6
3 5 4 7 10 12


Output

3
7 3 5

Input

5
-1 2 5 8 11


Output

1
8

Note

In the first example the answer is [7, 3, 5]. Note, that |7-3|=4=2^2, |7-5|=2=2^1 and |3-5|=2=2^1. You can't find a subset having more points satisfying the required property.

Solution (in JAVA):

Solution:

import java.io.IOException;
import java.util.*;

public class Points_and_Powers_of_Two {

    static class point implements Comparable<point> {

        public int value;
        public int index;

        public point(int v, int i) {
            value = v;
            index = i;
        }

        public int compareTo(point that) {
            return this.value - that.value;
        }
    }

    public static int binarySearch(point[] arr, int target) {
        int l = 0;
        int r = arr.length - 1;
        int mid = (l + r) / 2;
        while (l < r) {
            if (arr[mid].value > target) {
                r = mid - 1;
            } else if (arr[mid].value < target) {
                l = mid + 1;
            } else {
                return mid;
            }
            mid = (l + r) / 2;
        }
        if (arr[mid].value == target) {
            return mid;
        }
        return -1;
    }

    public static void main(String[] args) throws IOException {
        Scan in = new Scan();
        int[] power = new int[31];
        for (int i = 0; i < 31; i++) {
            power[i] = 1 << i;
        }
        int n = in.nextInt();
        point[] arr = new point[n];
        for (int i = 0; i < n; i++) {
            arr[i] = new point(in.nextInt(), i);
        }
        Arrays.sort(arr);
        int start = 0, mid = Integer.MAX_VALUE, end = Integer.MAX_VALUE, count = 0, ans = 0, pos1, pos2, p1 = 0, p2 = 0, p3 = 0;
        for (int i = 0; i < n; i++) {
            start = arr[i].value;
            count = 1;
            for (int j = 0; j < 31; j++) {
                pos1 = binarySearch(arr, start + power[j]);
                if (pos1 >= 0) {
                    end = arr[pos1].value;
                    pos2 = binarySearch(arr, (start + end) / 2);
                    if (j != 0 && pos2 >= 0) {
                        mid = arr[pos2].value;
                        count = 3;
                    } else {
                        count = 2;
                    }
                }
                if (count > ans) {
                    ans = count;
                    p1 = start;
                    p2 = mid;
                    p3 = end;
                    if(ans == 3) break;
                }
            }
        }
        if (ans == 1) {
            System.out.println("1\n" + p1);
        } else if (ans == 2) {
            System.out.println("2\n" + p1 + " " + p3);
        } else {
            System.out.println("3\n" + p1 + " " + p2 + " " + p3);
        }
    }

    static class Scan {

        public java.io.InputStream stream = System.in;
        private final static byte EOF = -1, NL = '\n', D = '-', SPC = ' ', buffer[] = new byte[0xFFFF];
        private char cBuff[] = new char[0xFF];
        public int $index, $readCount, itr;

        private void inc() {
            cBuff = java.util.Arrays.copyOf(cBuff, cBuff.length << 1);
        }

        private boolean readLINE() throws IOException {
            if ($readCount == EOF) {
                return false;
            }
            for (itr = 0;;) {
                while ($index < $readCount) {
                    if (buffer[$index] != NL) {
                        if (itr == cBuff.length) {
                            inc();
                        }
                        cBuff[itr++] = (char) buffer[$index++];
                    } else {
                        $index++;
                        return true;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return true;
                }
            }
        }

        private boolean readPRT() throws IOException {
            if ($readCount == EOF) {
                return false;
            }
            T:
            for (;;) {
                while ($index < $readCount) {
                    if (buffer[$index] > SPC) {
                        break T;
                    } else {
                        $index++;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return false;
                }
            }
            for (itr = 0;;) {
                while ($index < $readCount) {
                    if (buffer[$index] > SPC) {
                        if (itr == cBuff.length) {
                            inc();
                        }
                        cBuff[itr++] = (char) buffer[$index++];
                    } else {
                        return true;
                    }
                }
                $index = 0;
                $readCount = stream.read(buffer);
                if ($readCount == EOF) {
                    return true;
                }
            }
        }

        public int nextInt() throws IOException {
            if (!readPRT()) {
                throw new IOException();
            } else {
                int v = 0, i = 0;
                boolean neg;
                if (cBuff[i] == D) {
                    neg = true;
                    i++;
                } else {
                    neg = false;
                }
                while (i < itr) {
                    v = (v << 3) + (v << 1) + cBuff[i++] - '0';
                }
                return neg ? -v : v;
            }
        }

        public long nextLong() throws IOException {
            if (!readPRT()) {
                throw new IOException();
            } else {
                long v = 0;
                int i = 0;
                boolean neg;
                if (cBuff[i] == D) {
                    neg = true;
                    i++;
                } else {
                    neg = false;
                }
                while (i < itr) {
                    v = (v << 3L) + (v << 1L) + cBuff[i++] - '0';
                }
                return neg ? -v : v;
            }
        }

        public char[] buffer() throws IOException {
            return readPRT() ? cBuff : null;
        }

        public String next() throws IOException {
            return readPRT() ? new String(cBuff, 0, itr) : null;
        }

        public char[] nextArr() throws IOException {
            return readPRT() ? java.util.Arrays.copyOf(cBuff, itr) : null;
        }

        public String nextLine() throws IOException {
            return readLINE() ? new String(cBuff, 0, itr) : null;
        }

        public char[] nextLineArr() throws IOException {
            return readLINE() ? java.util.Arrays.copyOf(cBuff, itr) : null;
        }

        public float nextFloat() throws IOException {
            return Float.parseFloat(next());
        }

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