#include <bits/stdc++.h>
long long n;
std::set<long long> A;
void answer() {
  std::vector<long long> best = {*(A.begin())};
  for (long long i = 1; i < 1000000000000ll; i <<= 1) {
    for (auto &a : A) {
      std::vector<long long> cand = {a};
      if (A.find(a - i) != A.end()) cand.push_back(a - i);
      if (A.find(a + i) != A.end()) cand.push_back(a + i);
      if (cand.size() > best.size()) best = cand;
      if (best.size() == 3) break;
    }
    if (best.size() == 3) break;
  }
  std::cout << best.size() << "\n";
  for (auto i : best) std::cout << i << " ";
  std::cout << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::cin >> n;
  for (long long i = 0; i < n; ++i) {
    long long a;
    std::cin >> a;
    A.insert(a);
  }
  answer();
  return 0;
}
