#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> rec(set<int> a, int it = 0) {
  if (it >= 20) return vector<int>(20, 0);
  if (a.empty()) return vector<int>();
  int changed = 0;
  int best = 1;
  set<int> blah;
  for (auto i : a) {
    if (i % 2) {
      changed++;
      if ((i - 1) / 2) blah.insert((i - 1) / 2);
    } else if (i / 2)
      blah.insert(i / 2);
  }
  auto ans1 = rec(blah, it + 1);
  blah.clear();
  for (auto i : a) {
    if (i % 2) {
      changed++;
      if ((i + 1) / 2) blah.insert((i + 1) / 2);
    } else if (i / 2)
      blah.insert(i / 2);
  }
  auto ans2 = rec(blah, it + 1);
  if (ans2.size() < ans1.size()) {
    ans1.swap(ans2);
    best = -1;
  }
  for (auto &i : ans1) i *= 2;
  if (changed) ans1.push_back(best);
  return ans1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  set<int> a;
  int b;
  for (int i = 0; i < n; i++) cin >> b, a.insert(b);
  auto ans = rec(a);
  cout << ans.size() << endl;
  for (int i : ans) cout << i << " ";
  cout << endl;
}
