#include <bits/stdc++.h>
using namespace std;
int n, a[200005];
int search(int x) {
  int l = 0, r = n - 1, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (a[mid] == x)
      return mid;
    else if (a[mid] > x)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return -1;
}
int main() {
  int i, k, aa, bb;
  cin >> n;
  int va, vb;
  bool ch = 0;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < n; i++)
    for (k = 0; k < 32; k++) {
      aa = search(a[i] + (1 << k));
      bb = search(a[i] - (1 << k));
      if (aa != -1 && bb != -1) {
        cout << 3 << "\n" << a[aa] << " " << a[i] << " " << a[bb];
        return 0;
      }
      if (aa != -1) {
        ch = 1;
        va = a[i];
        vb = a[aa];
      } else if (bb != -1) {
        ch = 1;
        va = a[i];
        vb = a[bb];
      }
    }
  if (ch)
    cout << 2 << "\n" << va << " " << vb;
  else
    cout << 1 << "\n" << a[0];
  return 0;
}
