#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  vector<pair<int, int> > b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    int m = 1;
    while (true) {
      auto lo = lower_bound(a.begin(), a.end(), a[i] + m);
      if (lo == a.end()) break;
      if (*lo == a[i] + m) {
        b[i].push_back({lo - a.begin(), m});
      }
      if (a[i] + m * 2 > a[n - 1]) break;
      m *= 2;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < b[i].size(); j++) {
      for (int k = 0; k < b[b[i][j].first].size(); k++) {
        if (b[b[i][j].first][k].second == b[i][j].second) {
          cout << "3\n";
          cout << a[i] << ' ' << a[b[i][j].first] << ' '
               << a[b[b[i][j].first][k].first];
          return 0;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < b[i].size(); j++) {
      cout << "2\n";
      cout << a[i] << ' ' << a[b[i][j].first];
      return 0;
    }
  }
  cout << "1" << '\n' << a[0];
}
