#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long a[200001], A2, B2;
set<long long> st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", a + i), st.insert(a[i]);
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= 30; ++j) {
      long long kk = a[i] - (1ll << j);
      long long jj = a[i] + (1ll << j);
      if (st.count(kk) == 1 && st.count(jj) == 1) {
        puts("3");
        printf("%lld %lld %lld", kk, jj, a[i]);
        return 0;
      }
      if (st.count(kk) == 1 || st.count(jj) == 1) {
        if (st.count(kk) == 1)
          A2 = a[i], B2 = kk;
        else
          A2 = a[i], B2 = jj;
      }
    }
  }
  if (A2 || B2) {
    printf("2\n%lld %lld", A2, B2);
  } else
    printf("1\n%lld", a[1]);
  return 0;
}
