#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int MAX = 2e3 + 5;
const long long MAX2 = 11;
const long long MOD = 998244353;
const long long MOD2 = 1000000006;
const long long INF = 2e18;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 316;
int n, x, y, a, b, hit;
set<int> s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> x, s.insert(x);
  n = 1;
  for (auto i : s) {
    for (long long j = 0; j <= 30; ++j) {
      a = i - (1 << j), b = i + (1 << j);
      hit = 1;
      if (s.count(a)) ++hit;
      if (s.count(b)) ++hit;
      if (hit > n) {
        n = hit;
        if (hit == 2) {
          x = i;
          if (s.count(a))
            y = a;
          else
            y = b;
        } else
          return cout << "3\n" << i << ' ' << a << ' ' << b << '\n', 0;
      }
    }
  }
  cout << n << '\n' << x << ' ';
  if (n == 2) cout << y;
  return 0;
}
