#include <bits/stdc++.h>
using namespace std;
set<long long> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int x;
  cin >> x;
  long long y[x];
  for (int i = 0; i < x; i++) {
    cin >> y[i];
    m.insert(y[i]);
  }
  long long p1 = -1, p2;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < 64; j++) {
      long long mx = (1LL << j) + y[i];
      long long mn = y[i] - (1LL << j);
      if (m.find(mx) != m.end() && m.find(mn) != m.end()) {
        cout << "3\n" << y[i] << " " << mn << " " << mx;
        return 0;
      } else if (m.find(mx) != m.end()) {
        p1 = mx;
        p2 = y[i];
      } else if (m.find(mn) != m.end()) {
        p1 = mn;
        p2 = y[i];
      }
    }
  }
  if (p1 == -1)
    cout << "1\n" << y[0];
  else
    cout << "2\n" << p1 << " " << p2;
  return 0;
}
