#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, a[25][N], k, an[30], kk, ans[30];
void calc(int x, int r, int A) {
  bool bz = 0;
  if (k >= kk) return;
  for (int i = 1, E = r; i <= E; i++)
    if (a[x][i] & 1) {
      bz = 1;
      break;
    }
  if (r == 1 && (a[x][1] > 0 ? a[x][1] : -(a[x][1])) == 1 ||
      r == 2 && a[x][1] == -1 && !a[x][2]) {
    an[++k] = a[x][1] * A;
    calc(x + 1, 0, A);
    k--;
    return;
  }
  if (!r) {
    kk = k;
    memcpy(ans, an, sizeof an);
    return;
  }
  if (bz) {
    int rr = r;
    for (int i = 1, E = rr; i <= E; i++)
      a[x + 1][i] = a[x][i] - (a[x][i] & 1) >> 1;
    an[++k] = A;
    r = unique(a[x + 1], a[x + 1] + rr + 1) - a[x + 1] - 1;
    calc(x + 1, r, A << 1);
    for (int i = 1, E = rr; i <= E; i++)
      a[x + 1][i] = a[x][i] + (a[x][i] & 1) >> 1;
    an[k] = -A;
    r = unique(a[x + 1], a[x + 1] + rr + 1) - a[x + 1] - 1;
    calc(x + 1, r, A << 1);
    k--;
    return;
  }
  for (int i = 1, E = r; i <= E; i++) a[x + 1][i] = a[x][i] >> 1;
  r = unique(a[x + 1], a[x + 1] + r + 1) - a[x + 1] - 1;
  calc(x + 1, r, A << 1);
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, E = n; i <= E; i++) scanf("%d", &a[0][i]);
  sort(a[0] + 1, a[0] + n + 1);
  n = unique(a[0] + 1, a[0] + n + 1) - a[0] - 1;
  kk = 1e9;
  calc(0, n, 1);
  printf("%d\n", kk);
  for (int i = 1, E = kk; i <= E; i++) printf("%d ", ans[i]);
}
