#include <bits/stdc++.h>
using namespace std;
const int INF = 1.01e9;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  vector<int> st;
  vector<int> answer(20, -1);
  bool flag = 0;
  function<void(int, vector<int>)> rec = [&](int pos, vector<int> b) {
    if (st.size() >= answer.size()) return;
    if (b.empty()) {
      if (st.size() < answer.size() || flag) {
        answer = st;
        flag = 1;
      }
      return;
    }
    for (int cof = -1; cof <= 1; cof += 2) {
      int x = (1LL << (pos)) * cof;
      vector<int> tmp;
      vector<int> c;
      bool ff = 0;
      for (auto y : b) {
        if (y & (1LL << (pos))) {
          y -= x;
          ff = 1;
        }
        if (y != 0) {
          c.push_back(y);
        }
      }
      sort((c).begin(), c.end());
      c.resize(unique((c).begin(), c.end()) - c.begin());
      if (ff) {
        st.push_back(x);
      }
      rec(pos + 1, c);
      if (ff) {
        st.pop_back();
      }
    }
  };
  rec(0, a);
  cout << answer.size() << endl;
  for (auto x : answer) {
    cout << x << " ";
  }
  cout << endl;
  return 0;
}
