#include <bits/stdc++.h>
using namespace std;
set<long long> s;
long long a[200005];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  for (int i = 0; i < n; i++) {
    for (long long j = 1; j <= 2000000000LL; j <<= 1) {
      if (s.find(a[i] + j) != s.end() && s.find(a[i] + j + j) != s.end()) {
        cout << 3 << '\n';
        cout << a[i] << ' ' << a[i] + j << ' ' << a[i] + j + j << '\n';
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (long long j = 1; j <= 2000000000LL; j <<= 1) {
      if (s.find(a[i] + j) != s.end()) {
        cout << 2 << '\n';
        cout << a[i] << ' ' << a[i] + j << '\n';
        return 0;
      }
    }
  }
  cout << 1 << '\n' << a[0] << '\n';
  return 0;
}
