#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000011;
int n, a[maxn], A[maxn];
vector<int> ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  a[++n] = 0;
  for (int ok = 1, S = 0; ok;) {
    for (int s = 0;; ++s) {
      int mn = 1e9, mx = -1e9;
      for (int i = 1; i <= n; ++i) {
        A[i] = (a[i] + (1 << 30)) & ((2 << s) - 1);
        if (A[i] >= (1 << s)) A[i] -= 1 << (s + 1);
        mn = min(mn, A[i]);
        mx = max(mx, A[i]);
      }
      if (mx - mn + 1 <= (1 << s)) {
        for (int i = 0; i < s; ++i)
          if (mx >> i & 1)
            ans.push_back(1 << (i + S));
          else
            ans.push_back(-(1 << (i + S)));
        ok = 0;
        for (int i = 1; i <= n; ++i) ok |= (a[i] = (a[i] - A[i]) >> (s + 1));
        S += s + 1;
        break;
      }
    }
  }
  printf("%u\n", ans.size());
  for (auto x : ans) printf("%d ", x);
  return 0;
}
