#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> inp(n);
  vector<long long> power;
  map<long long, bool> avl;
  for (long long i = 0; i < n; i++) {
    cin >> inp[i];
    avl[inp[i]] = true;
  }
  power.push_back(1);
  long long number = 1;
  sort(inp.begin(), inp.end());
  for (long long j = 1;; j++) {
    number = number * 2;
    power.push_back(number);
    if (number > 1e10 + 10) break;
  }
  for (long long i = 0; i < n; i++) {
    long long num = inp[i];
    for (long long j = 0;; j++) {
      long long chk1 = num + power[j];
      long long chk2 = num + power[j + 1];
      if (chk1 > inp[n - 1]) break;
      if (avl[chk1] && avl[chk2]) {
        cout << 3 << endl;
        cout << num << " " << chk1 << " " << chk2 << endl;
        return 0;
      }
    }
  }
  for (long long i = 0; i < n - 1; i++) {
    long long num = inp[i];
    for (long long j = 0;; j++) {
      long long chk = num + power[j];
      if (chk > inp[n - 1]) break;
      if (avl[chk]) {
        cout << 2 << endl;
        cout << num << " " << chk << endl;
        return 0;
      }
    }
  }
  cout << 1 << endl;
  cout << inp[0] << endl;
  return 0;
}
