#include <bits/stdc++.h>
using namespace std;
long long a[200005];
long long f[200005][50];
long long solve(long long z, long long n) {
  long long l = 1, r = n, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (a[mid] == z)
      return mid;
    else if (a[mid] > z)
      r = mid - 1;
    else if (a[mid] < z)
      l = mid + 1;
  }
  return -1;
}
long long x, y, z;
bool pan3(long long n) {
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= 40; j++) {
      if (f[i][j] != -1 && f[f[i][j]][j] != -1) {
        x = i;
        y = f[i][j];
        z = f[f[i][j]][j];
        return true;
      }
    }
  }
  return false;
}
bool pan2(long long n) {
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= 40; j++)
      if (f[i][j] != -1) {
        x = i;
        y = f[i][j];
        return true;
      }
  }
  return false;
}
int main() {
  long long n;
  scanf("%I64d", &n);
  for (long long i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  sort(a + 1, a + 1 + n);
  for (long long i = 1; i <= n; i++) {
    z = 1;
    for (long long j = 0; j <= 40; j++) {
      f[i][j] = solve(a[i] + z, n);
      z <<= 1;
    }
  }
  if (pan3(n)) {
    printf("3\n");
    printf("%I64d %I64d %I64d\n", a[x], a[y], a[z]);
  } else if (pan2(n)) {
    printf("2\n");
    printf("%I64d %I64d\n", a[x], a[y]);
  } else {
    printf("1\n");
    printf("%I64d\n", a[1]);
  }
}
