#include <bits/stdc++.h>
using namespace std;
int scale(char c) {
  if (c <= '9' && c >= '0') return c - '0';
  if (c <= 'Z' && c >= 'A') return c - 'A' + 1;
  return c - 'a' + 1;
}
int main() {
  set<long long> s;
  long long n, m;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> m;
    s.insert(m);
  }
  for (auto it : s) {
    for (long long i = 1; i < 1e10; i *= 2) {
      if (s.find(it + i) != s.end() && s.find(it + 2 * i) != s.end()) {
        printf("3\n");
        printf("%lld %lld %lld\n", it, it + i, it + 2 * i);
        return 0;
      }
    }
  }
  for (auto it : s) {
    for (long long i = 1; i < 1e10; i *= 2) {
      if (s.find(it + i) != s.end()) {
        printf("2\n");
        printf("%lld %lld\n", it, it + i);
        return 0;
      }
    }
  }
  cout << 1 << '\n';
  cout << *s.begin() << '\n';
  return 0;
}
