#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
int a[N];
map<int, int> fre;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    fre[a[i]]++;
  }
  sort(a + 1, a + n + 1);
  n = unique(a + 1, a + n + 1) - (a + 1);
  int b[3];
  int totAns = 0;
  for (int i = 1; i <= n; ++i) {
    int s1 = a[i];
    for (int bit = 0; bit <= 30; ++bit) {
      int s2 = s1 + (1 << bit);
      int s3 = s2 + (1 << bit);
      if (fre[s1] + fre[s2] + fre[s3] > totAns) {
        totAns = fre[s1] + fre[s2] + fre[s3];
        b[0] = s1;
        b[1] = s2;
        b[2] = s3;
      }
    }
  }
  printf("%d\n", totAns);
  for (int i = 0; i <= 2; ++i)
    for (int j = 1; j <= fre[b[i]]; ++j) printf("%d ", b[i]);
  return 0;
}
