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.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author prakharjain
 */
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);
        _949E solver = new _949E();
        solver.solve(1, in, out);
        out.close();
    }

    static class _949E {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            int[] a = new int[n];

            Set<Integer> s = new HashSet<>();
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                s.add(a[i]);
            }

            List<Integer> l = rec(s, n, 0);

            StringBuilder ans = new StringBuilder();
            ans.append(l.size());
            ans.append(System.lineSeparator());
            for (int i = 0; i < l.size(); i++) {
                ans.append(l.get(i));
                ans.append(" ");
            }

            out.println(ans.toString());
        }

        List<Integer> rec(Set<Integer> a, int n, int div) {
            if (isZero(a, n)) {
                return new ArrayList<>();
            }
            int val = -1;
            if ((val = isOne(a, n)) != -3) {
                List<Integer> l = new ArrayList<>();
                val = isOne(a, n);
                if (val == -2) {
                    l.add((1 << div));
                    l.add(-1 * (1 << div));
                } else {
                    l.add(val * (1 << div));
                }
                return l;
            }
            if (isOdd(a, n)) {
                //-1
                //int[] b = Arrays.copyOf(a, n);
                HashSet<Integer> b = new HashSet<>();
                for (Integer num : a) {
                    if (num % 2 == 1 || num % 2 == -1) {
                        b.add(num + 1);
                    } else {
                        b.add(num);
                    }
                }
                List<Integer> l1 = rec(div(b, n), n, div + 1);
                //1
                b = new HashSet<>();
                for (Integer num : a) {
                    if (num % 2 == 1 || num % 2 == -1) {
                        b.add(num - 1);
                    } else {
                        b.add(num);
                    }
                }
                List<Integer> l2 = rec(div(b, n), n, div + 1);

                if (l1.size() <= l2.size()) {
                    l1.add(-1 * (1 << div));
                    return l1;
                } else {
                    l2.add((1 << div));
                    return l2;
                }
            } else {
                Set<Integer> b = new HashSet<>(a);
                List<Integer> l = rec(div(b, n), n, div + 1);
                return l;
            }
        }

        boolean isOdd(Set<Integer> a, int n) {
            for (Integer num : a) {
                if (num % 2 == 1 || num % 2 == -1) {
                    return true;
                }
            }
            return false;
        }

        boolean isZero(Set<Integer> a, int n) {
            for (Integer num : a) {
                if (num != 0)
                    return false;
            }
            return true;
        }

        int isOne(Set<Integer> a, int n) {
            int mo = 0;
            int z = 0;
            int po = 0;
            for (Integer num : a) {
                if (Math.abs(num) > 1)
                    return -3;
                else {
                    switch (num) {
                        case -1:
                            mo++;
                            break;
                        case 1:
                            po++;
                            break;
                        case 0:
                            z++;
                            break;
                    }
                }
            }
            if (mo > 0 && po > 0)
                return -2;
            return mo > po ? -1 : 1;
        }

        Set<Integer> div(Set<Integer> a, int n) {
            Set<Integer> b = new HashSet<>();
            for (Integer num : a) {
                b.add(num / 2);
            }
            return b;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

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

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}