#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long arr[200009];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  {
    long long a, b, c, d, i, j, k, l, m, n, sum = 0, temp = 0, f = 0, cnt = 0,
                                            ff = -1, fff = -1, p = 0, q = 0;
    cin >> n;
    for (i = 0; i < n; i++) cin >> arr[i];
    sort(arr, arr + n);
    vector<long long> vec;
    f = 1;
    while (f < 10e10) {
      vec.push_back(f);
      f *= 2;
    }
    m = vec.size();
    long long ans = LLONG_MIN;
    f = arr[0];
    for (i = 0; i < n; i++) {
      for (j = 0; j < m - 1; j++) {
        a = vec[j];
        b = vec[j + 1];
        c = arr[i] + a;
        d = arr[i] + b;
        int in1, in2;
        k = 0;
        in1 = lower_bound(arr, arr + n, c) - arr;
        in2 = upper_bound(arr, arr + n, c) - arr;
        k += in2 - in1;
        in1 = lower_bound(arr, arr + n, d) - arr;
        in2 = upper_bound(arr, arr + n, d) - arr;
        k += in2 - in1;
        k++;
        if (k > ans) {
          ans = k;
          f = arr[i];
          ff = vec[j] + arr[i];
          fff = vec[j + 1] + arr[i];
        }
        c = arr[i] - a;
        d = arr[i] - b;
        k = 0;
        in1 = lower_bound(arr, arr + n, c) - arr;
        in2 = upper_bound(arr, arr + n, c) - arr;
        k += in2 - in1;
        in1 = lower_bound(arr, arr + n, d) - arr;
        in2 = upper_bound(arr, arr + n, d) - arr;
        k += in2 - in1;
        k++;
        if (k > ans) {
          ans = k;
          f = arr[i];
          ff = arr[i] - vec[j];
          fff = arr[i] - vec[j + 1];
        }
      }
    }
    cout << ans << "\n";
    if (ans == 1)
      cout << arr[0] << "\n";
    else {
      cout << f << " ";
      if (ff != -1) {
        int in1, in2;
        in1 = lower_bound(arr, arr + n, ff) - arr;
        in2 = upper_bound(arr, arr + n, ff) - arr;
        p = in2 - in1;
        for (i = 0; i < p; i++) cout << ff << " ";
      }
      if (fff != -1) {
        int in1, in2;
        in1 = lower_bound(arr, arr + n, fff) - arr;
        in2 = upper_bound(arr, arr + n, fff) - arr;
        q = in2 - in1;
        for (i = 0; i < q; i++) cout << fff << " ";
      }
    }
  }
}
