#include <bits/stdc++.h>
using namespace std;
long long n, a[200010], sz = 0;
vector<long long> ans;
int main() {
  scanf("%I64d", &n);
  for (long long i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n);
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 31; j++) {
      long long b = lower_bound(a, a + n, a[i] + (1ll << j)) - a,
                c = lower_bound(a, a + n, a[i] + (1ll << (j + 1))) - a, s = 1;
      vector<long long> temp;
      temp.push_back(a[i]);
      if (b < n && a[b] == a[i] + (1ll << j)) {
        s++;
        temp.push_back(a[b]);
      }
      if (c < n && a[c] == a[i] + (1ll << (j + 1))) {
        s++;
        temp.push_back(a[c]);
      }
      if (s > sz) {
        sz = s;
        ans = temp;
      }
    }
  }
  printf("%I64d\n", sz);
  for (long long i = 0; i < sz; i++) printf("%I64d ", ans[i]);
  return 0;
}
