#include <bits/stdc++.h>
using namespace std;
long long a[200005];
vector<long long> ans;
set<long long> exist;
vector<int> check;
int main() {
  long long pw = 1;
  for (int i = 0; i < 31; i++) {
    check.push_back(pw);
    pw *= 2;
  }
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    exist.insert(a[i]);
  }
  sort(a + 1, a + 1 + n);
  ans.push_back(a[1]);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < check.size(); j++) {
      long long val = check[j];
      vector<long long> tmp;
      tmp.push_back(a[i]);
      if (exist.count(a[i] - val)) tmp.push_back(a[i] - val);
      if (exist.count(a[i] + val)) tmp.push_back(a[i] + val);
      if (tmp.size() > ans.size()) ans = tmp;
      tmp.clear();
      tmp.push_back(a[i]);
      if (exist.count(a[i] - val)) tmp.push_back(a[i] - val);
      if (exist.count(a[i] - 2 * val)) tmp.push_back(a[i] - 2 * val);
      if (tmp.size() > ans.size()) ans = tmp;
      tmp.clear();
      tmp.push_back(a[i]);
      if (exist.count(a[i] + val)) tmp.push_back(a[i] + val);
      if (exist.count(a[i] + 2 * val)) tmp.push_back(a[i] + 2 * val);
      if (tmp.size() > ans.size()) ans = tmp;
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%lld ", ans[i]);
}
