#include <bits/stdc++.h>
using namespace std;
void start() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  cout.precision(10);
}
bool cmp(string x, string y) {
  if (x.size() == y.size()) return x < y;
  return x.size() < y.size();
}
int32_t main() {
  start();
  long long n;
  cin >> n;
  set<long long> st;
  long long x;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    st.insert(x);
  }
  for (long long i = 0; i < 35; i++) {
    for (auto x : st) {
      if (st.find(x - pow(2, i)) != st.end() &&
          st.find(x + pow(2, i)) != st.end()) {
        cout << 3 << "\n";
        cout << x - pow(2, i) << " " << x << " " << x + pow(2, i) << "\n";
        return 0;
      }
    }
  }
  for (long long i = 0; i < 35; i++) {
    for (auto x : st) {
      if (st.find(x - pow(2, i)) != st.end()) {
        cout << 2 << "\n";
        cout << x - pow(2, i) << " " << x << "\n";
        return 0;
      }
      if (st.find(x + pow(2, i)) != st.end()) {
        cout << 2 << "\n";
        cout << x + pow(2, i) << " " << x << "\n";
        return 0;
      }
    }
  }
  cout << 1 << "\n";
  cout << *st.begin() << "\n";
  return 0;
}
