#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 50;
const int inf = 1e9;
const int hash_size = 1e6 + 7;
int a[maxn];
int head[hash_size];
int Next[maxn];
int minv = inf;
int maxv = -inf;
int two[40];
void hash_insert(int i) {
  int h = (a[i] + inf) % hash_size;
  Next[i] = head[h];
  head[h] = i;
}
int vis(long long x) {
  if (x > maxv || x < minv) return 0;
  int h = (x + inf) % hash_size;
  int u = head[h];
  while (u) {
    if (a[u] == x) return u;
    u = Next[u];
  }
  return 0;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    minv = min(minv, a[i]);
    maxv = max(maxv, a[i]);
    hash_insert(i);
  }
  two[0] = 1;
  for (int i = 1; i <= 30; ++i) two[i] = two[i - 1] << 1;
  int ans = 1;
  int t[3] = {a[1]};
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= 30; ++j) {
      int x = vis((long long)a[i] + two[j]);
      int y = vis((long long)a[i] - two[j]);
      if (ans < 2) {
        int u = x ? x : y;
        if (u) {
          ans = 2;
          t[0] = a[i];
          t[1] = a[u];
        }
      }
      if (ans < 3 && x && y) {
        ans = 3;
        t[0] = a[i];
        t[1] = a[x];
        t[2] = a[y];
        break;
      }
    }
    if (ans == 3) break;
  }
  printf("%d\n", ans);
  for (int i = 0; i < ans; ++i) printf("%d ", t[i]);
  return 0;
}
