#include <bits/stdc++.h>
using std::map;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T abs(T num) {
  return num > 0 ? num : -num;
}
int main() {
  int n;
  scanf("%d", &n);
  long long x;
  map<long long, int> dic;
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &x);
    dic[x] = 1;
  }
  long long ans[5], k = 0;
  for (long long i = 1; i < 2147483648ll; i <<= 1) {
    for (auto &it : dic) {
      long long le = it.first - i;
      long long ri = it.first + i;
      auto pl = dic.find(le);
      auto pr = dic.find(ri);
      if (pl != dic.end() && pr != dic.end())
        return printf("3\n%lld %lld %lld", le, ri, it.first) * 0;
      else if (pl != dic.end() || pr != dic.end()) {
        k = 2;
        ans[0] = it.first;
        if (pl != dic.end())
          ans[1] = le;
        else
          ans[1] = ri;
      } else if (k == 0 && it.first == i) {
        k = 1;
        ans[0] = it.first;
      }
    }
  }
  if (k == 0) return !printf("1\n%lld", x);
  printf("%lld\n", k);
  for (int i = 0; i < k; ++i) printf("%lld ", ans[i]);
  return 0;
}
