#include <bits/stdc++.h>
using namespace std;
set<long long> s;
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int i;
  for (i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    s.insert(x);
  }
  bool ok3 = false;
  bool ok2 = false;
  for (auto x : s) {
    int i;
    for (i = 0; i <= 30; i++) {
      long long x1 = x - (1ll << i);
      long long x2 = x + (1ll << i);
      if ((s.find(x1) != s.end()) && (s.find(x2) != s.end())) {
        ok3 = true;
        ans.push_back(x1);
        ans.push_back(x2);
        ans.push_back(x);
        break;
      }
    }
    if (ok3) break;
  }
  if (ok3) {
    cout << 3 << "\n";
    for (int x : ans) cout << x << " ";
    return 0;
  }
  for (auto x : s) {
    int i;
    for (i = 0; i <= 30; i++) {
      long long x2 = x + (1ll << i);
      if (s.find(x2) != s.end()) {
        ok2 = true;
        ans.push_back(x2);
        ans.push_back(x);
        break;
      }
    }
    if (ok2) break;
  }
  if (ok2) {
    cout << 2 << "\n";
    for (int x : ans) cout << x << " ";
    return 0;
  }
  cout << 1 << "\n";
  cout << *s.begin() << "\n";
  return 0;
}
