Problem: It is never too late to play the fancy "Binary Cards" game!

There is an infinite amount of cards of positive and negative ranks that are used in the game. The absolute value of any card rank is a power of two, i.e. each card has a rank of either 2k or  - 2k for some integer k ≥ 0. There is an infinite amount of cards of any valid rank.

At the beginning of the game player forms his deck that is some multiset (possibly empty) of cards. It is allowed to pick any number of cards of any rank but the small deck is considered to be a skill indicator. Game consists of n rounds. In the i-th round jury tells the player an integer ai. After that the player is obligated to draw such a subset of his deck that the sum of ranks of the chosen cards is equal to ai (it is allowed to not draw any cards, in which case the sum is considered to be equal to zero). If player fails to do so, he loses and the game is over. Otherwise, player takes back all of his cards into his deck and the game proceeds to the next round. Player is considered a winner if he is able to draw the suitable set of cards in each of the rounds.

Somebody told you which numbers ai the jury is going to tell you in each round. Now you want to pick a deck consisting of the minimum number of cards that allows you to win the "Binary Cards" game.

Input

The first line of input contains an integer n (1 ≤ n ≤ 100 000), the number of rounds in the game.

The second line of input contains n integers a1, a2, ..., an ( - 100 000 ≤ ai ≤ 100 000), the numbers that jury is going to tell in each round.

Output

In the first line print the integer k (0 ≤ k ≤ 100 000), the minimum number of cards you have to pick in your deck in ordered to win the "Binary Cards".

In the second line print k integers b1, b2, ..., bk ( - 220 ≤ bi ≤ 220, |bi| is a power of two), the ranks of the cards in your deck. You may output ranks in any order. If there are several optimum decks, you are allowed to print any of them.

It is guaranteed that there exists a deck of minimum size satisfying all the requirements above.

Examples

Input

1
9


Output

2
1 8


Input

5
-1 3 0 4 7


Output

3
4 -1 4


Input

4
2 -2 14 18


Output

3
-2 2 16

Note

In the first sample there is the only round in the game, in which you may simply draw both your cards. Note that this sample test is the only one satisfying the first test group constraints.

In the second sample you may draw the only card  - 1 in the first round, cards 4 and  - 1 in the second round, nothing in the third round, the only card 4 in the fourth round and the whole deck in the fifth round.

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author palayutm
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        ProblemEBinaryCards solver = new ProblemEBinaryCards();
        solver.solve(1, in, out);
        out.close();
    }

    static class ProblemEBinaryCards {
        void add(IntArrayList arr, int v) {
            if (v == 0) return;
            if (arr.isEmpty() || arr.getLast() != v) {
                arr.add(v);
            }
        }

        public IntArrayList solve(int[] a) {
            if (a.length == 0) return new IntArrayList();
            if (a.length == 1) {
                if (a[0] == 1) return new IntArrayList(1, 1);
                if (a[0] == -1) return new IntArrayList(1, -1);
            }
            IntArrayList left = new IntArrayList();
            IntArrayList right = new IntArrayList();
            int cnt = 0;
            for (int x : a) {
                if ((x & 1) != 0) {
                    add(left, (x - 1) / 2);
                    add(right, (x + 1) / 2);
                    cnt++;
                } else {
                    add(left, x / 2);
                    add(right, x / 2);
                }
            }
            IntArrayList lret = solve(left.toArray());
            IntArrayList rret = solve(right.toArray());
            IntArrayList ans = (lret.size() > rret.size() ? rret : lret);
            for (int i = 0; i < ans.size(); i++) {
                ans.set(i, ans.get(i) * 2);
            }
            if (cnt > 0) {
                ans.add(lret.size() > rret.size() ? -1 : 1);
            }
            return ans;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int[] a = in.nextIntArray(n);
            Arrays.sort(a);
            int[] ans = solve(a).toArray();
            ArrayUtil.reverse(ans);
            out.println(ans.length);
            out.println(ans);
        }

    }

    static class ArrayUtil {
        public static void reverse(int[] a, int from, int to) {
            for (int i = from, j = to - 1; i < j; i++, j--) {
                int t = a[i];
                a[i] = a[j];
                a[j] = t;
            }
        }

        public static void reverse(int[] a) {
            reverse(a, 0, a.length);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int readByte() {
            if (lenbuf == -1) throw new UnknownError();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = stream.read(inbuf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream out) {
            super(out);
        }

        public OutputWriter(Writer out) {
            super(out);
        }

        public void close() {
            super.close();
        }

        public void print(int[] a) {
            for (int i = 0; i < a.length; i++) {
                if (i != 0) {
                    print(' ');
                }
                print(a[i]);
            }
        }

        public void println(int[] a) {
            print(a);
            println();
        }

    }

    static class IntArrayList {
        private static final int DEFAULT_CAPACITY = 10;
        int[] array;
        int size;

        public IntArrayList() {
            this(DEFAULT_CAPACITY);
        }

        public IntArrayList(int capacity) {
            array = new int[capacity];
            size = 0;
        }

        public IntArrayList(int size, int initialValue) {
            String s;
            array = new int[size];
            Arrays.fill(array, initialValue);
            this.size = size;
        }

        public IntArrayList(int[] src) {
            array = Arrays.copyOf(src, src.length);
            size = array.length;
        }

        public int get(int index) {
            if (index < 0 || index >= size) {
                throw new IndexOutOfBoundsException("Index " + index + " is out of range, size = " + size);
            }
            return array[index];
        }

        public void set(int index, int value) {
            if (index < 0 || index >= size) {
                throw new IndexOutOfBoundsException("Index " + index + " is out of range, size = " + size);
            }
            array[index] = value;
        }

        public int getLast() {
            return get(size - 1);
        }

        public void add(int value) {
            if (size == array.length) {
                enLarge();
            }
            array[size++] = value;
        }

        public int size() {
            return size;
        }

        public boolean isEmpty() {
            return size() == 0;
        }

        public int[] toArray() {
            return Arrays.copyOf(array, size);
        }

        private void enLarge() {
            int[] newArray = new int[(int) (array.length << 1)];
            System.arraycopy(array, 0, newArray, 0, size);
            array = newArray;
        }

    }
}