#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, a;
  set<long long> second;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    second.insert(a);
  }
  for (auto v : second) {
    for (i = 1; i <= 2e9; i *= 2) {
      if (second.find(v + i) != second.end() &&
          second.find(v + 2 * i) != second.end()) {
        cout << "3\n";
        cout << v << " " << v + i << " " << v + 2 * i;
        return 0;
      }
    }
  }
  for (auto v : second) {
    for (i = 1; i <= 2e9; i *= 2) {
      if (second.find(v + i) != second.end()) {
        cout << "2\n";
        cout << v << " " << v + i;
        return 0;
      }
    }
  }
  cout << "1\n";
  cout << *(second.begin());
  return 0;
}
