#include <bits/stdc++.h>
using namespace std;
const int maxK = 2e5 + 5;
int n;
vector<int> x;
void ReadInput() {
  cin >> n;
  x.resize(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  sort(x.begin(), x.end());
}
void Solve() {
  vector<int> res = {x[0]};
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 31; j++) {
      int lx = x[i] - (1 << j);
      int rx = x[i] + (1 << j);
      bool isl = binary_search(x.begin(), x.end(), lx);
      bool isr = binary_search(x.begin(), x.end(), rx);
      if (isl && isr && (int)res.size() < 3) res = {lx, x[i], rx};
      if (isl && (int)res.size() < 2) res = {lx, x[i]};
      if (isr && (int)res.size() < 2) res = {x[i], rx};
    }
  cout << res.size() << '\n';
  for (int it : res) cout << it << ' ';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ReadInput();
  Solve();
}
