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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
namespace fastIN {
char frdbuf[21000000], *frdp1, *frdpend;
inline char gc() { return *++frdp1; }
void rd(int &x) {
  int c = gc(), f = 0;
  while (!(c == '-' || (c >= '0' && c <= '9'))) c = gc();
  if (c == '-') f = 1, c = gc();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = gc();
  if (f) x = -x;
}
inline void initfrd() {
  frdp1 = frdbuf - 1, frdpend = frdbuf + fread(frdbuf, 1, 21000000, stdin);
}
};  // namespace fastIN
using namespace fastIN;
namespace fastOUT {
char fotout[4000000], *fotop1 = fotout - 1;
const char fotDigit[200] = {
    '0', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '0', '6', '0',
    '7', '0', '8', '0', '9', '1', '0', '1', '1', '1', '2', '1', '3', '1', '4',
    '1', '5', '1', '6', '1', '7', '1', '8', '1', '9', '2', '0', '2', '1', '2',
    '2', '2', '3', '2', '4', '2', '5', '2', '6', '2', '7', '2', '8', '2', '9',
    '3', '0', '3', '1', '3', '2', '3', '3', '3', '4', '3', '5', '3', '6', '3',
    '7', '3', '8', '3', '9', '4', '0', '4', '1', '4', '2', '4', '3', '4', '4',
    '4', '5', '4', '6', '4', '7', '4', '8', '4', '9', '5', '0', '5', '1', '5',
    '2', '5', '3', '5', '4', '5', '5', '5', '6', '5', '7', '5', '8', '5', '9',
    '6', '0', '6', '1', '6', '2', '6', '3', '6', '4', '6', '5', '6', '6', '6',
    '7', '6', '8', '6', '9', '7', '0', '7', '1', '7', '2', '7', '3', '7', '4',
    '7', '5', '7', '6', '7', '7', '7', '8', '7', '9', '8', '0', '8', '1', '8',
    '2', '8', '3', '8', '4', '8', '5', '8', '6', '8', '7', '8', '8', '8', '9',
    '9', '0', '9', '1', '9', '2', '9', '3', '9', '4', '9', '5', '9', '6', '9',
    '7', '9', '8', '9', '9'};
inline void out11(const int x) {
  *++fotop1 = fotDigit[x << 1], *++fotop1 = fotDigit[x << 1 | 1];
}
inline void out12(const int x) {
  if (x >= 10) *++fotop1 = fotDigit[x << 1];
  *++fotop1 = fotDigit[x << 1 | 1];
}
inline void out21(const int x) {
  out11(x / 100);
  out11(x % 100);
}
inline void out22(const int x) {
  out12(x / 100);
  out11(x % 100);
}
inline void out31(const int x) {
  out21(x / 10000);
  out21(x % 10000);
}
inline void out32(const int x) {
  out22(x / 10000);
  out21(x % 10000);
}
inline void out42(const long long x) {
  out32(x / 100000000);
  out31(x % 100000000);
}
inline void prt(int x) {
  if (x < 0) *++fotop1 = '-', x = ~x + 1;
  if (x < 100)
    out12(x);
  else if (x < 10000)
    out22(x);
  else if (x < 1000000)
    out22(x / 100), out11(x % 100);
  else if (x < 100000000)
    out32(x);
  else
    out32(x / 100), out11(x % 100);
}
inline void prt(long long x) {
  if (x < 0) *++fotop1 = '-', x = ~x + 1;
  if (x < 100)
    out12(x);
  else if (x < 10000)
    out22(x);
  else if (x < 1000000)
    out22(x / 100), out11(x % 100);
  else if (x < 100000000)
    out32(x);
  else if (x < 10000000000)
    out32(x / 100), out11(x % 100);
  else if (x < 1000000000000)
    out32(x / 10000), out21(x % 10000);
  else if (x < 100000000000000)
    out32(x / 1000000), out21(x / 100 % 10000), out11(x % 100);
  else if (x < 10000000000000000)
    out42(x);
  else if (x < 1000000000000000000)
    out42(x / 100), out11(x % 100);
  else
    out42(x / 10000), out21(x % 10000);
}
inline void prt(const char x) { *++fotop1 = x; }
inline void flushfot() { fwrite(fotout, 1, fotop1 - fotout + 1, stdout); }
}  // namespace fastOUT
using namespace fastOUT;
int f[20][1048579 * 2], a[400005], n, M, ans = 1023043;
vector<int> U, V;
int main() {
  initfrd();
  rd(n);
  for (int i = 1; i <= n; i++) {
    rd(a[i]);
    if (M < a[i]) M = a[i];
  }
  n = n + 1;
  for (int i = 1; i <= n; i++) a[i] = a[i] - M;
  for (int i = 1; i < 20; i++) {
    for (int j = 1; j <= n; j++) f[i][a[j] & ((1 << i) - 1)]++;
    for (int j = 1; j < (1 << i); j++) f[i][j] += f[i][j - 1];
  }
  for (int i = 0, res; i <= 400000; i++) {
    U.clear();
    res = 0;
    for (int j = 1, t, l, r; j < 20; j++) {
      t = (i & ((1 << j) - 1)), l = (1 << (j - 1)) - t, r = (1 << j) - 1 - t;
      l = ((l + (1 << j)) & ((1 << j) - 1));
      r = ((r + (1 << j)) & ((1 << j) - 1));
      if (l <= r) {
        int tp;
        if (l)
          tp = f[j][l - 1];
        else
          tp = 0;
        if (f[j][r] - tp) {
          res++;
          U.push_back(1 << (j - 1));
        }
      } else {
        int tp;
        if (l)
          tp = f[j][l - 1];
        else
          tp = 0;
        if (f[j][r] + f[j][(1 << j) - 1] - tp) {
          res++;
          U.push_back(1 << (j - 1));
        }
      }
    }
    for (int j = 0; j < U.size(); j++)
      if ((i - M) & U[j]) U[j] = -U[j];
    if (res < ans) ans = res, V = U;
  }
  prt(ans);
  prt('\n');
  for (int i = 0; i < V.size(); i++) prt(V[i]), prt(' ');
  flushfot();
}