#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double err = 1e-9;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;
vector<ll> pt;
set<ll> b;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  ll v = 1;
  while (v < 2e9) {
    pt.push_back(v);
    v *= 2LL;
  }
  ll x;
  for (int(i) = (0); (i) < (n); (i)++) cin >> x, b.insert(x);
  vector<ll> ans;
  for (auto k : b) {
    for (auto d : pt) {
      bool pl = b.count(k - d);
      bool pr = b.count(k + d);
      int as = pl + pr + 1;
      if (as > (int)ans.size()) {
        ans.clear();
        ans.push_back(k);
        if (pl) ans.push_back(k - d);
        if (pr) ans.push_back(k + d);
      }
    }
  }
  cout << (int)ans.size() << endl;
  for (auto e : ans) cout << e << ' ';
  cout << endl;
  return 0;
}
