#include <bits/stdc++.h>
using namespace std;
int a[1000005];
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]] = 1;
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 32; j++) {
      int x = 1 << j;
      if (mp[a[i] + x] && mp[a[i] + 2 * x]) {
        cout << 3 << endl;
        cout << a[i] << " " << a[i] + x << " " << a[i] + x * 2 << endl;
        return 0;
      }
      if (a[i] + x > a[n - 1] || a[i] + 2 * x > a[n - 1]) break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 32; j++) {
      int x = 1 << j;
      if (mp[a[i] + x]) {
        cout << 2 << endl;
        cout << a[i] << " " << a[i] + x << endl;
        return 0;
      }
      if (mp[a[i] + x * 2]) {
        cout << 2 << endl;
        cout << a[i] << " " << a[i] + 2 * x << endl;
        return 0;
      }
      if (a[i] + x > a[n - 1] || a[i] + 2 * x > a[n - 1]) break;
    }
  }
  cout << 1 << endl;
  cout << a[0] << endl;
  return 0;
}
