#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, a[maxn], an[maxn], b[21][maxn], fac[25], ans[maxn];
void dfs(int dep) {
  if (dep > 20) {
    if (an[0] < ans[0]) {
      for (int i = 0; i <= an[0]; i++) {
        ans[i] = an[i];
      }
    }
    return;
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] & fac[dep]) flag = 1;
  }
  if (!flag)
    dfs(dep + 1);
  else {
    int cnt = n;
    for (int i = 1; i <= cnt; i++) {
      b[dep][i] = a[i];
    }
    an[++an[0]] = fac[dep];
    for (int i = 1; i <= cnt; i++) {
      if (b[dep][i] & fac[dep]) {
        a[i] = b[dep][i] - fac[dep];
      } else
        a[i] = b[dep][i];
    }
    sort(a + 1, a + cnt + 1);
    n = 0;
    for (int i = 1; i <= cnt; i++) {
      if (i == 1 || a[i] != a[i - 1]) {
        a[++n] = a[i];
      }
    }
    dfs(dep + 1);
    an[an[0]] = -fac[dep];
    n = 0;
    for (int i = 1; i <= cnt; i++) {
      if (b[dep][i] & fac[dep]) {
        a[i] = b[dep][i] + fac[dep];
      } else
        a[i] = b[dep][i];
    }
    for (int i = 1; i <= cnt; i++) {
      if (i == 1 || a[i] != a[i - 1]) {
        a[++n] = a[i];
      }
    }
    dfs(dep + 1);
    an[0]--;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  fac[0] = 1;
  for (int i = 1; i <= 20; i++) {
    fac[i] = fac[i - 1] * 2;
  }
  ans[0] = 30;
  dfs(0);
  printf("%d\n", ans[0]);
  for (int i = 1; i <= ans[0]; i++) {
    printf("%d ", ans[i]);
  }
}
