#include <bits/stdc++.h>
const int N = (int)2e5 + 7;
const int MAXN = (int)2e3;
const int LN = 20;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-8;
const int MOD = (int)1e9;
const long long LINF = (int64_t)1e18;
const int INF = (int)2e9;
const int DEL = (int)1e6 + 1;
const int PR = 115249;
using namespace std;
template <typename T>
T sqr(T a) {
  return a * a;
}
int n;
long long a[N];
set<long long> s;
void read() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
}
void solve() {
  int val = 0;
  vector<long long> ans;
  for (int i = 0; i < n; i++) {
    for (long long j = 0; j < 32; j++) {
      long long p = (1 << j);
      int res = 1;
      vector<long long> cur = {a[i]};
      if (s.count(a[i] + p)) {
        res++, cur.push_back(a[i] + p);
        if (s.count(a[i] + 2 * p)) res++, cur.push_back(a[i] + 2 * p);
      }
      if (val < res) val = res, ans = cur;
    }
  }
  cout << val << "\n";
  for (long long x : ans) cout << x << ' ';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  read();
  solve();
}
