#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 100005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  string s = "/home/jslijin/jslijin/code/";
  freopen((s + "code.in").c_str(), "r", stdin);
  freopen((s + "code.out").c_str(), "w", stdout);
}
vector<int> a[22], cur, ans;
int n, x, t;
void dfs(int x) {
  if (cur.size() >= ans.size()) return;
  sort((a[x]).begin(), (a[x]).end()),
      a[x].resize(unique((a[x]).begin(), (a[x]).end()) - a[x].begin());
  if (x > 20) {
    if (a[x].size() == 1 && !a[x][0]) ans = cur;
    return;
  }
  t = 0;
  for (__typeof((a[x]).begin()) it = (a[x]).begin(); it != (a[x]).end(); it++)
    t |= ((*it >> x) & 1);
  if (!t) {
    a[x + 1] = a[x], dfs(x + 1);
    return;
  }
  int y = 1 << x;
  cur.push_back(y), a[x + 1].clear();
  for (__typeof((a[x]).begin()) it = (a[x]).begin(); it != (a[x]).end(); it++)
    a[x + 1].push_back((*it & y) ? *it - y : *it);
  dfs(x + 1);
  cur[cur.size() - 1] *= -1, a[x + 1].clear();
  for (__typeof((a[x]).begin()) it = (a[x]).begin(); it != (a[x]).end(); it++)
    a[x + 1].push_back((*it & y) ? *it + y : *it);
  dfs(x + 1), cur.pop_back();
}
int main() {
  scanf("%d", &n), ans.resize(30);
  for (int i = (1); i <= (n); ++i) scanf("%d", &x), a[0].push_back(x);
  dfs(0);
  printf("%d\n", ans.size());
  for (__typeof((ans).begin()) it = (ans).begin(); it != (ans).end(); it++)
    printf("%d ", *it);
  return 0;
}
