#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n);
  set<int> ans;
  ans.insert(arr[0]);
  map<int, int> mp;
  for (auto x : arr) mp[x] = 1;
  for (auto x : arr) {
    for (int i = 0; i < 32; ++i) {
      int temp = 1LL << i;
      int cnt = 1;
      set<int> s;
      s.insert(x);
      while (cnt < 3) {
        if (!mp[x + (cnt * temp)]) break;
        s.insert(x + (cnt * temp));
        cnt++;
      }
      if (s.size() > ans.size()) {
        ans = s;
      }
    }
  }
  cout << ans.size() << '\n';
  for (auto x : ans) {
    cout << x << " ";
  }
  return 0;
}
