#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
struct compare {
  inline bool operator()(const std::string& first,
                         const std::string& second) const {
    return first.size() < second.size();
  }
};
void solve() {
  int n;
  cin >> n;
  int a[n + 1];
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 31; j++) {
      vector<int> tmp = {a[i]};
      int l_x = a[i] - (1 << j);
      int r_x = a[i] + (1 << j);
      if (s.find(l_x) != s.end()) {
        tmp.push_back(l_x);
      }
      if (s.find(r_x) != s.end()) {
        tmp.push_back(r_x);
      }
      if (tmp.size() > ans.size()) {
        ans = tmp;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto x : ans) {
    cout << x << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
