#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> vt;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    vt.push_back(t);
  }
  stable_sort(vt.begin(), vt.end());
  for (int i = 0; i < n; i++) {
    long long int y = vt[i];
    for (int j = 0; j < 31; j++) {
      long long int t = (1LL << j);
      if (binary_search(vt.begin(), vt.end(), y + t) &&
          binary_search(vt.begin(), vt.end(), y - t)) {
        cout << 3 << endl;
        cout << y - t << " " << y << " " << y + t << endl;
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    long long int y = vt[i];
    for (int j = 0; j < 31; j++) {
      long long int t = (1LL << j);
      if (binary_search(vt.begin(), vt.end(), y + t)) {
        cout << 2 << endl;
        cout << y << " " << y + t << endl;
        return 0;
      }
    }
  }
  cout << 1 << endl;
  cout << vt[0] << endl;
  return 0;
}
