#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
using matrix = vector<vector<long long>>;
const int MAXN = 2e5 + 100;
int a[MAXN];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  int ans = 0;
  vector<int> v;
  cin >> n;
  set<int> setik;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    setik.insert(a[i]);
  }
  for (int i = 0; i < n; ++i) {
    for (long long j = 0; j < 40; ++j) {
      long long lf = a[i] * 1ll - (1ll << j);
      long long rg = a[i] * 1ll + (1ll << j);
      bool f1 = (lf >= -1e9 ? setik.count((int)lf) : false);
      bool f2 = (rg <= 1e9 ? setik.count((int)rg) : false);
      if (f1 && f2) {
        if (ans < 3) {
          ans = 3;
          v.clear();
          v.push_back(lf);
          v.push_back(a[i]);
          v.push_back(rg);
        }
      } else if (f1) {
        if (ans < 2) {
          ans = 2;
          v.clear();
          v.push_back(lf);
          v.push_back(a[i]);
        }
      } else if (f2) {
        if (ans < 2) {
          ans = 2;
          v.clear();
          v.push_back(a[i]);
          v.push_back(rg);
        }
      } else {
        if (ans < 1) {
          ans = 1;
          v.clear();
          v.push_back(a[i]);
        }
      }
    }
  }
  cout << ans << '\n';
  for (int i : v) {
    cout << i << ' ';
  }
}
