#include<bits/stdc++.h> #define re register #define int long long
usingnamespace std;
constint N = 2e5 + 10; int n,arr[N]; map<int,bool> vis;
inlineintread(){ int r = 0,w = 1; char c = getchar(); while (c < '0' || c > '9'){ if (c == '-') w = -1; c = getchar(); } while (c >= '0' && c <= '9'){ r = (r << 3) + (r << 1) + (c ^ 48); c = getchar(); } return r * w; }
signedmain(){ n = read(); for (re int i = 1;i <= n;i++) arr[i] = read(),vis[arr[i]] = true; for (re int i = 1;i <= n;i++){ for (re int j = 0;j <= 30;j++){ int t = (1ll << j); if (vis.count(arr[i] + t) && vis.count(arr[i] + 2 * t)) returnprintf("3\n%lld %lld %lld",arr[i],arr[i] + t,arr[i] + 2 * t),0; } } for (re int i = 1;i <= n;i++){ for (re int j = 0;j <= 30;j++){ int t = (1ll << j); if (vis.count(arr[i] + t)) returnprintf("2\n%lld %lld",arr[i],arr[i] + t),0; } } printf("1\n%lld",arr[1]); return0; }