#include <bits/stdc++.h>
const static int t[31] = {
    1,         2,         4,         8,        16,       32,       64,
    128,       256,       512,       1024,     2048,     4096,     8192,
    16384,     32768,     65536,     131072,   262144,   524288,   1048576,
    2097152,   4194304,   8388608,   16777216, 33554432, 67108864, 134217728,
    268435456, 536870912, 1073741824};
int a[200005];
int cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
bool find(int l, int r, int ans) {
  int mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (a[mid] == ans)
      return true;
    else if (a[mid] < ans)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return false;
}
int main() {
  int n, j, i, x1, x2;
  bool p = false;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  qsort(a, n, sizeof(a[0]), cmp);
  for (i = 0; i < n; i++)
    for (j = 0; j < 31; j++)
      if (find(0, i - 1, a[i] - t[j])) {
        p = true;
        x1 = a[i] - t[j];
        x2 = a[i];
        if (find(i + 1, n - 1, a[i] + t[j])) {
          printf("3\n%d %d %d", a[i] - t[j], a[i], a[i] + t[j]);
          return 0;
        }
      }
  if (p)
    printf("2\n%d %d", x1, x2);
  else
    printf("1\n%d", a[0]);
  return 0;
}
