#include <bits/stdc++.h>
using namespace std;
int n;
long long a[2 * 100009];
void xl() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  vector<int> q;
  for (int i = 1; i <= n; i++) {
    if ((a[i] & (a[i] - 1)) == 0) {
      q.push_back(a[i]);
      break;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (long long d = 1; d < (1LL << 31); d *= 2) {
      int p1 = lower_bound(a + 1, a + n + 1, a[i] + d) - a;
      int p2 = lower_bound(a + 1, a + n + 1, a[i] - d) - a;
      vector<int> qq;
      qq.push_back(a[i]);
      if (p1 && p1 <= n && a[p1] == a[i] + d) {
        qq.push_back(a[p1]);
      }
      if (p2 && p1 <= n && a[p2] == a[i] - d) {
        qq.push_back(a[p2]);
      }
      if (qq.size() > q.size()) {
        q = qq;
      }
      if (q.size() == 3) {
        break;
      }
    }
    if (q.size() == 3) {
      break;
    }
  }
  cout << q.size() << endl;
  for (int v : q) {
    cout << v << " ";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  xl();
}
