#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]] = 1;
  }
  int x, y, count = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 31; j++) {
      int left = a[i] - (1 << j);
      int right = a[i] + (1 << j);
      if (mp.count(left) && mp.count(right)) {
        cout << 3 << endl << left << " " << a[i] << " " << right << endl;
        return 0;
      }
      if (mp.count(left)) {
        x = left;
        y = a[i];
        count++;
      }
      if (mp.count(right)) {
        x = right;
        y = a[i];
        count++;
      }
    }
  }
  if (count != 0) {
    cout << 2 << endl << x << " " << y << endl;
  } else {
    cout << 1 << endl << a[0];
  }
  return 0;
}
