#include <bits/stdc++.h>
using namespace std;
mt19937 rng((int)std::chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  set<long long> a;
  for (long long i = 0, j; i < n; i++) {
    cin >> j;
    a.insert(j);
  }
  long long maxd = *a.rbegin() - *a.begin();
  vector<long long> ans = {*a.begin()};
  for (auto &x : a) {
    for (long long diff = 1; diff <= maxd; diff *= 2) {
      if (a.count(x + diff) and a.count(x + 2 * diff)) {
        ans = {x, x + diff, x + 2 * diff};
      } else if (a.count(x + diff)) {
        if (ans.size() < 2) ans = {x, x + diff};
      }
    }
  }
  cout << ans.size() << endl;
  for (auto &x : ans) cout << x << " ";
  cout << endl;
}
