#include <bits/stdc++.h>
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i += 1) cin >> a[i];
  ;
  sort(a.begin(), a.end());
  vector<int> ans;
  for (int i = 0; i < n; i += 1) {
    for (int j = 0; j < 31; j += 1) {
      int pv = a[i] - (1 << j);
      int nx = a[i] + (1 << j);
      bool pv_find = binary_search(a.begin(), a.end(), pv);
      bool nx_find = binary_search(a.begin(), a.end(), nx);
      if (pv_find && nx_find) {
        ans = {pv, a[i], nx};
        break;
      } else if (pv_find)
        ans = {pv, a[i]};
      else if (nx_find)
        ans = {a[i], nx};
    }
    if ((int)ans.size() == 3) break;
  }
  if (ans.empty()) ans.push_back(a[0]);
  cout << (int)ans.size() << "\n";
  for (int i = 0; i < (int)ans.size(); i += 1) cout << ans[i] << ' ';
  ;
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
