#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  int t = 1;
  while (t--) {
    long long n, i, j, k, x, y, z, w, t1, t2, t3, ans = 0, MX = LLONG_MIN;
    set<long long> s;
    cin >> n;
    vector<long long> v(n), fans;
    for (i = 0; i < n; i++) {
      cin >> v[i];
      s.insert(v[i]);
      MX = max(MX, v[i]);
    }
    w = 0;
    for (i = 0; i <= 31; i++) {
      y = (1LL << i);
      for (j = 0; j < n; j++) {
        x = 1;
        if (s.find(y + v[j]) != s.end()) {
          x++;
          if (s.find(2 * y + v[j]) != s.end()) x++;
        }
        if (x > ans) ans = x, t2 = j, t1 = y;
      }
    }
    fans.push_back(v[t2]);
    if (s.find(t1 + v[t2]) != s.end()) {
      x++;
      fans.push_back(v[t2] + t1);
      if (s.find(2 * t1 + v[t2]) != s.end())
        fans.push_back(2 * t1 + v[t2]), x++;
    }
    cout << fans.size() << "\n";
    for (i = 0; i < fans.size(); i++) cout << fans[i] << " ";
  }
  return 0;
}
