#include <bits/stdc++.h>
using namespace std;
int Size, Array[int(2e5 + 10)];
vector<int> MaxPoint;
map<int, int> Mark;
void Read() {
  scanf("%d", &Size);
  for (int n, i = 0; i < Size; i++) {
    scanf("%d", Array + i);
    Mark[Array[i]] = true;
  }
  sort(Array, Array + Size);
  for (int i = 0; i < Size; i++) {
    for (long long Move = 2; Move <= 2e9 + 10; Move *= 2) {
      int Find = Array[i] + Move;
      vector<int> Tester;
      Tester.push_back(Array[i]);
      if (Mark[Find]) {
        Tester.push_back(Find);
      }
      if (Mark[Array[i] + Move / 2]) {
        Tester.push_back(Array[i] + Move / 2);
      }
      if (Tester.size() > MaxPoint.size()) {
        MaxPoint = Tester;
      }
    }
  }
}
void Write() {
  printf("%d\n", int(MaxPoint.size()));
  for (int i = 0; i < MaxPoint.size(); i++) {
    printf("%d ", MaxPoint[i]);
  }
}
int main() {
  Read();
  Write();
}
