#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
void solve() {
  long long int n, x, ans = 1, p = -1, q = -1, c;
  cin >> n;
  set<long long int> s;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i], s.insert(a[i]);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < 32; j++) {
      c = 1;
      if (s.find(a[i] - (1 << j)) != s.end()) {
        q = a[i] - (1 << j);
        c++;
      }
      if (s.find(a[i] + (1 << j)) != s.end()) {
        q = a[i] + (1 << j);
        c++;
      }
      if (c == 3) {
        cout << 3 << "\n";
        cout << a[i] - (1 << j) << " " << a[i] << " " << a[i] + (1 << j);
        return;
      }
      if (c == 2) p = a[i];
      ans = max(ans, c);
    }
  }
  cout << ans << "\n";
  if (ans == 2) cout << p << " " << q;
  if (ans == 1) cout << a[0];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
