#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
inline void cmin(int &x, int y) {
  if (y < x) x = y;
}
inline void cmax(int &x, int y) {
  if (y > x) x = y;
}
int main() {
  int n, a[200005];
  set<int> seti;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    seti.insert(a[i]);
  }
  sort(a, a + n);
  vector<int> ans;
  pair<int, int> an;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 30; j++) {
      if (seti.count(a[i] + (1 << j))) {
        flag = 1;
        an = make_pair(a[i], a[i] + (1 << j));
        if (seti.count(a[i] + (1 << (j + 1)))) {
          return !printf("3\n%d %d %d", a[i], a[i] + (1 << j),
                         a[i] + (1 << (j + 1)));
        }
      }
    }
  }
  if (flag)
    printf("2\n%d %d", an.first, an.second);
  else
    printf("1\n%d", a[0]);
  return 0;
}
