#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[n], i, j;
  set<long long> s;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  sort(a, a + n);
  long long ans = 1, maxd = a[n - 1] - a[0], dist, sta = a[0];
  for (i = 1; i <= maxd; i *= 2) {
    bool maxa = false;
    for (j = 0; j < n; j++) {
      if (s.count(a[j] + i)) {
        ans = 2;
        sta = a[j];
        dist = i;
        if (s.count(a[j] + 2 * i)) {
          ans = 3;
          maxa = true;
          break;
        }
      }
    }
    if (maxa) break;
  }
  cout << ans << endl;
  cout << sta << " ";
  if (ans > 1) cout << sta + dist << " ";
  if (ans > 2) cout << sta + 2 * dist << " ";
  return 0;
}
