#include <bits/stdc++.h>
using namespace std;
int arr[100000], n;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
template <typename T, typename... Types>
void sout(T var1, Types... var2) {
  cout << var1 << " ";
  sout(var2...);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  vector<long long int> res;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < 31; j++) {
      bool find_more = binary_search(v.begin(), v.end(), v[i] + (1 << j));
      bool find_less = binary_search(v.begin(), v.end(), v[i] - (1 << j));
      if (find_less and find_more) {
        res = {v[i], v[i] + (1 << j), v[i] - (1 << j)};
        break;
      }
      if (find_less) res = {v[i], v[i] - (1 << j)};
      if (find_more) res = {v[i], v[i] + (1 << j)};
    }
    if (res.size() == 3) break;
  }
  if (res.size() < 2)
    cout << 1 << "\n" << v[0];
  else
    cout << res.size() << endl;
  for (auto c : res) cout << c << " ";
  return 0;
}
void heapify(int arr[], int n, int i) {
  int largest = i;
  int l = 2 * i + 1;
  int r = 2 * i + 2;
  if (l < n && arr[l] > arr[largest]) largest = l;
  if (r < n && arr[r] > arr[largest]) largest = r;
  if (largest != i) {
    swap(arr[i], arr[largest]);
    heapify(arr, n, largest);
  }
}
void heapSort(int arr[], int n) {
  for (int i = n / 2 - 1; i >= 0; i--) heapify(arr, n, i);
  for (int i = n - 1; i > 0; i--) {
    swap(arr[0], arr[i]);
    heapify(arr, i, 0);
  }
}
