#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
long long a[N];
void __print(long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
int32_t main() {
  long long n;
  cin >> n;
  set<long long> f;
  for (long long x = 1; x <= n; x++) {
    cin >> a[x];
    f.insert(a[x]);
  }
  sort(a + 1, a + n + 1);
  vector<long long> ans = {a[1]};
  for (long long x = 1; x <= n; x++) {
    long long val = a[x];
    for (long long i = 0; i < 33; i++) {
      long long one = val + (1LL << (i));
      long long two = val - (1LL << (i));
      bool pres1 = f.count(one);
      bool pres2 = f.count(two);
      if (pres1 and pres2 and (ans.size() < 3)) {
        ans = {one, val, two};
      }
      if (pres1 and (ans.size() < 2)) {
        ans = {one, val};
      }
      if (pres2 and (ans.size() < 2)) {
        ans = {val, two};
      }
    }
  }
  cout << ans.size() << endl;
  for (auto xx : ans) cout << xx << " ";
  cout << endl;
  return 0;
}
