#include <bits/stdc++.h>
using namespace std;
int n, a[300000];
set<int> st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), st.insert(a[i]);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 30; j++)
      if (st.count(a[i] - (1 << j)) && st.count(a[i] + (1 << j)))
        return printf("3\n%d %d %d\n", a[i], a[i] - (1 << j), a[i] + (1 << j)),
               0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= 30; j++)
      if (st.count(a[i] + (1 << j)))
        return printf("2\n%d %d\n", a[i], a[i] + (1 << j)), 0;
  return printf("1\n%d\n", a[1]), 0;
}
