#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<int> X(N);
  for (int& x : X) {
    cin >> x;
  }
  sort(X.begin(), X.end());
  for (int x : X) {
    for (int j = 0; j <= 30; ++j) {
      int len = 1 << j;
      if (binary_search(X.begin(), X.end(), x - len) &&
          binary_search(X.begin(), X.end(), x + len)) {
        cout << 3 << '\n';
        cout << x - len << ' ' << x << ' ' << x + len << '\n';
        return 0;
      }
    }
  }
  for (int x : X) {
    for (int j = 0; j <= 30; ++j) {
      int len = 1 << j;
      if (binary_search(X.begin(), X.end(), x + len)) {
        cout << 2 << '\n';
        cout << x << ' ' << x + len << '\n';
        return 0;
      }
    }
  }
  cout << 1 << '\n';
  cout << X[0] << '\n';
  return 0;
}
