#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<long long> v(n);
  set<long long> s;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    s.insert(v[i]);
  }
  sort(v.begin(), v.end());
  int ans = 1;
  long long left = 0;
  long long right = 0;
  long long ele = 0;
  for (int i = 1; i < n - 1; i++) {
    for (int j = 0; j <= 30; j++) {
      long long temp = 1 << j;
      if (s.find(v[i] - temp) != s.end() && s.find(v[i] + temp) != s.end()) {
        ans = 3;
        ele = v[i];
        left = v[i] - temp;
        right = v[i] + temp;
        break;
      }
    }
  }
  if (ans != 3) {
    for (int i = 0; i < n - 1; i++) {
      for (int j = 0; j <= 30; j++) {
        long long temp = pow(2, j);
        if (s.find(v[i] + temp) != s.end()) {
          ans = 2;
          ele = v[i];
          right = v[i] + temp;
          break;
        }
      }
    }
  }
  if (ans == 3) {
    cout << ans << "\n";
    cout << left << " " << ele << " " << right << "\n";
  } else if (ans == 2) {
    cout << ans << "\n";
    cout << ele << " " << right << "\n";
  } else {
    cout << 1 << "\n";
    cout << v[0] << "\n";
  }
  return 0;
}
