#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const int N = 1e6 + 10;
const int M = 1e5 + 10;
const long long mod = 1e9 + 7;
const double PI = acos(-1);
inline long long ab(long long x) { return x < 0 ? -x : x; }
inline long long mm(long long x) {
  return x >= mod ? x - mod : x < 0 ? x + mod : x;
}
vector<int> ans, now;
void solve(int deep, int mid, vector<int> v) {
  if (now.size() >= ans.size() || deep > 20) return;
  if (accumulate(v.begin(), v.end(), 0) - v[mid] == 0) {
    ans = now;
    return;
  }
  bool flag = false;
  for (int i = 0; i < v.size(); ++i) flag |= ((i - mid) & 1) && v[i];
  if (flag) {
    for (int t = -1; t <= 1; t += 2) {
      int mmid = mid >> 1, to;
      now.push_back(t * (1 << deep));
      vector<int> vv(mid + 1, 0);
      for (int i = 0; i < v.size(); ++i) {
        to = (i - mid) % 2 == 0 ? (i - mid) / 2 + mmid
                                : (i - mid - t) / 2 + mmid;
        vv[to] += v[i];
      }
      solve(deep + 1, mmid, vv);
      now.pop_back();
    }
  } else {
    int mmid = mid >> 1;
    vector<int> vv(mid + 1, 0);
    for (int i = 0; i < v.size(); ++i) vv[((i - mid) >> 1) + mmid] += v[i];
    solve(deep + 1, mmid, vv);
  }
}
int main() {
  int n, x;
  scanf("%d", &n);
  vector<int> v((1 << 20) + 1, 0);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &x);
    v[x + (1 << 19)]++;
  }
  for (int i = 1; i <= 20; ++i) ans.push_back(0);
  solve(0, 1 << 19, v);
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
  return 0;
}
