#include <bits/stdc++.h>
using namespace std;
set<long long int> st;
vector<long long int> ans, v;
int main() {
  ios::sync_with_stdio(0);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    long long int val;
    cin >> val;
    v.push_back(val);
    st.insert(val);
  }
  ans.push_back(v[0]);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 1; v[i] + j <= 1000000000; j *= 2) {
      vector<long long int> temp;
      temp.push_back(v[i]);
      if (st.count(v[i] + j)) temp.push_back(v[i] + j);
      if (v[i] - j >= -1000000000 && st.count(v[i] - j))
        temp.push_back(v[i] - j);
      if (temp.size() > ans.size()) ans = temp;
    }
    if (ans.size() == 3) break;
  }
  cout << ans.size() << endl;
  for (long long int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
