#include <bits/stdc++.h>
using namespace std;
set<long long> points;
int n;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    points.insert(x);
  }
  long long bestStart = *(points.begin());
  long long bestLen = 1;
  long long bestGap = 0;
  for (long long s : points) {
    for (int i = 0; i <= 30; i++) {
      if (points.count(s + (1 << i))) {
        bestStart = s;
        bestGap = 1 << i;
        bestLen = 2;
        if (points.count(s + (2LL << i))) {
          cout << "3\n";
          cout << s << " " << s + (1 << i) << " " << s + (2LL << i);
          return 0;
        }
      }
    }
  }
  cout << bestLen << "\n";
  cout << bestStart << " ";
  if (bestLen == 2) cout << bestStart + bestGap;
}
