#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e9;
ifstream in("input.txt");
ofstream out("output.txt");
;
long long n;
vector<long long> vec;
void init() {
  cin >> n;
  vec.resize(n);
  for (long long i = 0; i < n; i++) cin >> vec[i];
  sort(vec.begin(), vec.end());
}
vector<long long> find2() {
  vector<long long> ans;
  for (long long i = 1; i < n; i++) {
    for (long long j = 0; j <= 31; j++) {
      if (binary_search(vec.begin(), vec.end(), vec[i] - (1 << j))) {
        ans.push_back(vec[i]);
        ans.push_back(vec[i] - (1 << j));
        return ans;
      }
    }
  }
  return ans;
}
vector<long long> find3() {
  vector<long long> ans;
  for (long long i = 1; i < n; i++) {
    for (long long j = 0; j <= 31; j++) {
      if (binary_search(vec.begin(), vec.end(), vec[i] - (1 << j)) &&
          binary_search(vec.begin(), vec.end(), vec[i] - 2 * (1 << j))) {
        ans.push_back(vec[i]);
        ans.push_back(vec[i] - (1 << j));
        ans.push_back(vec[i] - 2 * (1 << j));
        return ans;
      }
    }
  }
  return ans;
}
void outans(vector<long long> cc) {
  cout << cc.size() << "\n";
  for (long long i = 0; i < cc.size(); i++) {
    cout << cc[i] << " ";
  }
  exit(0);
}
void solve() {
  vector<long long> f2 = find3();
  if (f2.size()) outans(f2);
  f2 = find2();
  if (f2.size()) outans(f2);
  cout << 1 << "\n";
  cout << vec[0];
}
signed main() {
  init();
  solve();
  return 0;
}
