#include <bits/stdc++.h>
using namespace std;
const int N = 233333;
const int M = 3333333;
const int INF = 123456789;
const int MOD = 420047;
void gcd(long long a, long long b, long long &d, long long &x, long long &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    gcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long a[N];
int n;
int main() {
  int cases = 1;
  for (int iii = 1; iii <= cases; ++iii) {
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) scanf("%I64d", &a[i]);
    sort(a, a + n);
    bool ok = false;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < 35; ++j) {
        int x = lower_bound(a, a + n, a[i] + (1LL << j)) - a;
        int y = lower_bound(a, a + n, a[i] + (2LL << j)) - a;
        if (x < n && y < n && a[x] == a[i] + (1LL << j) &&
            a[y] == a[i] + (2LL << j)) {
          printf("3\n%I64d %I64d %I64d\n", a[i], a[i] + (1LL << j),
                 a[i] + (2LL << j));
          return 0;
        }
      }
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < 35; ++j) {
        int x = lower_bound(a, a + n, a[i] + (1LL << j)) - a;
        if (x < n && a[x] == a[i] + (1LL << j)) {
          printf("2\n%I64d %I64d", a[i], a[i] + (1LL << j));
          return 0;
        }
      }
    }
    printf("1\n%I64d\n", a[0]);
  }
}
