#include <bits/stdc++.h>
const int Maxn = 200010;
int n;
int a[Maxn];
std ::map<int, bool> vis;
int main() {
  scanf("%d", &n);
  for (register int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    vis[a[i]] = true;
  }
  std ::sort(a + 1, a + n + 1);
  for (register int i = 1; i <= n; i++) {
    for (register int j = 0; j <= 31; j++) {
      register int x = 1 << j;
      if (vis[a[i] + x] && vis[a[i] + x * 2]) {
        printf("3\n%d %d %d\n", a[i], a[i] + x, a[i] + x * 2);
        return 0;
      }
      if (a[i] + x > a[n] || a[i] + x * 2 > a[n]) break;
    }
  }
  for (register int i = 1; i <= n; i++) {
    for (register int j = 0; j <= 31; j++) {
      register int x = 1 << j;
      if (vis[a[i] + x]) {
        printf("2\n%d %d\n", a[i], a[i] + x);
        return 0;
      }
      if (vis[a[i] + x * 2]) {
        printf("2\n%d %d\n", a[i], a[i] + x * 2);
        return 0;
      }
      if (a[i] + x > a[n] || a[i] + x * 2 > a[n]) break;
    }
  }
  printf("1\n%d\n", a[1]);
  return 0;
}
