#include <bits/stdc++.h>
using namespace std;
long long n, a[200010];
bool check(long long x) {
  long long l = 1, r = n;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (a[mid] > x)
      r = mid - 1;
    else if (a[mid] < x)
      l = mid + 1;
    if (a[mid] == x) return true;
  }
  return false;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long j = 0;
  while (j <= 30) {
    long long cnt = (long long)pow(2, j);
    for (int i = 1; i <= n; i++) {
      if (check(a[i] - cnt) && check(a[i] + cnt)) {
        cout << "3\n";
        cout << a[i] << " " << a[i] - cnt << " " << a[i] + cnt;
        return 0;
      }
    }
    j++;
  }
  j = 0;
  while (j <= 30) {
    long long cnt = (long long)pow(2, j);
    for (int i = 1; i <= n; i++) {
      if (check(a[i] + cnt)) {
        cout << "2\n";
        cout << a[i] << " " << a[i] + cnt;
        return 0;
      }
      if (check(a[i] - cnt)) {
        cout << "2\n";
        cout << a[i] << " " << a[i] - cnt;
        return 0;
      }
    }
    j++;
  }
  cout << "1\n" << a[1];
  return 0;
}
