#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 1, delta = 1e9 + 7;
long long nums[maxn];
int32_t main() {
  ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
  long long n, x = 0, y = 0;
  cin >> n;
  for (long long(i) = (0); (i) < (n); ++(i)) cin >> nums[i];
  sort(nums, nums + n);
  for (long long(i) = (0); (i) < (n); ++(i))
    for (long long(j) = (0); (j) < (31); ++(j)) {
      long long a = nums[i] + (1 << j), b = nums[i] + (1 << (j + 1));
      if (binary_search(nums, nums + n, a) && binary_search(nums, nums + n, b))
        return cout << 3 << "\n" << nums[i] << ' ' << a << ' ' << b, 0;
      if (binary_search(nums, nums + n, a)) x = nums[i], y = a;
    }
  if (x != 0 || y != 0)
    cout << 2 << "\n" << x << ' ' << y;
  else
    cout << 1 << ' ' << nums[0];
}
