#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int g = 0; g < 33; g++) {
      long long k = pow(2ll, g);
      int f = 0;
      if (binary_search(a, a + n, k + a[i])) {
        cnt = max(cnt, 2);
        v = {a[i], k + a[i]};
        f = 1;
      }
      if (binary_search(a, a + n, 2 * k + a[i]) && f == 1) {
        cnt = 3;
        v = {a[i], k + a[i], 2 * k + a[i]};
        cout << cnt << endl;
        cout << v[0] << " " << v[1] << " " << v[2];
        return 0;
      }
    }
  }
  if (cnt == 2) {
    cout << 2 << endl;
    cout << v[0] << " " << v[1];
    return 0;
  }
  cout << 1 << endl;
  cout << a[0] << endl;
  return 0;
}
