#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ii = long long;
int main() {
  int n;
  scanf("%d", &n);
  vector<ii> v(n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &v[i]);
  }
  sort(v.begin(), v.end());
  ii a = v[0], b = -1, c = -1;
  for (int i = 0; i < n; ++i) {
    ii d = 1;
    for (int j = 0; j < 31; ++j) {
      if (binary_search(v.begin(), v.end(), (ii)v[i] + d)) {
        if (b == -1) {
          a = v[i];
          b = v[i] + d;
        }
        ii y = d * 2;
        if (binary_search(v.begin(), v.end(), (ii)v[i] + y)) {
          if (c == -1) {
            a = v[i];
            b = v[i] + d;
            c = v[i] + y;
          }
        }
      }
      d *= 2;
    }
  }
  printf("%d\n", 1 + (b != -1) + (c != -1));
  printf("%d ", a);
  if (b != -1) printf("%d ", b);
  if (c != -1) printf("%d ", c);
}
