#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 9;
int n, vl, ans, tmp[110000], ret[110000];
void redo(vector<int>& a) {
  int i, j, s, p, q, nn = 0;
  for (i = 0; i < a.size(); i++) {
    if (nn == 0 || a[nn - 1] < a[i]) a[nn++] = a[i];
  }
  a.resize(nn);
}
void dfs(int id, vector<int>& a, int now) {
  int i, j, s, p, q;
  if (ans <= now) return;
  for (i = 0; i < a.size(); i++) {
    if (a[i] != 0) break;
  }
  if (i >= a.size()) {
    ans = now;
    for (i = 0; i < now; i++) ret[i] = tmp[i];
    return;
  }
  if (id >= 18) return;
  bool you = false;
  for (i = 0; i < a.size(); i++) {
    if (abs(a[i]) & (1 << id)) {
      you = true;
      break;
    }
  }
  if (!you)
    dfs(id + 1, a, now);
  else {
    vector<int> na;
    na.resize(a.size());
    tmp[now] = (1 << id);
    for (i = 0; i < a.size(); i++) {
      if (abs(a[i]) & (1 << id))
        na[i] = a[i] - (1 << id);
      else
        na[i] = a[i];
    }
    sort(na.begin(), na.end());
    redo(na);
    dfs(id + 1, na, now + 1);
    tmp[now] = -(1 << id);
    na.resize(a.size());
    for (i = 0; i < a.size(); i++) {
      if (abs(a[i]) & (1 << id))
        na[i] = a[i] + (1 << id);
      else
        na[i] = a[i];
    }
    sort(na.begin(), na.end());
    redo(na);
    dfs(id + 1, na, now + 1);
  }
}
int main() {
  vector<int> a;
  a.clear();
  scanf("%d", &n);
  int i, j, s, p, q;
  for (i = 0; i < n; i++) {
    scanf("%d", &vl);
    a.push_back(vl);
  }
  sort(a.begin(), a.end());
  redo(a);
  ans = inf;
  dfs(0, a, 0);
  printf("%d\n", ans);
  for (i = 0; i < ans; i++) printf("%d ", ret[i]);
  printf("\n");
  return 0;
}
