#include <bits/stdc++.h>
using namespace std;
int main() {
  const int INF = 1e9, N = 2e5 + 1;
  const bool DEBUG = 0;
  if (DEBUG) {
    freopen("input.txt", "r", stdin);
  }
  int n;
  scanf("%d", &n);
  set<long long> a;
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    a.insert(x);
  }
  long long s = 1;
  long long ans1 = -1, ans2 = -1;
  for (; s <= 2 * INF; s *= 2) {
    for (auto i = a.begin(); i != a.end(); i++) {
      long long x = *i;
      auto r = a.find(x + s);
      if (r != a.end() && a.find(x + 2 * s) != a.end()) {
        printf("3\n%lld %lld %lld", x, s + x, s + s + x);
        return 0;
      } else if (ans1 == -1 && ans1 == ans2 && r != a.end()) {
        ans1 = x;
        ans2 = x + s;
      }
    }
  }
  if (ans1 == ans2 && ans1 == -1)
    printf("1\n%lld", *(a.begin()));
  else
    printf("2\n%lld %lld", ans1, ans2);
}
