#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll MAX_N = 2e5; int main(){ ll m; cin >> m; ll k; for(ll i=1; i<=100; i++){ ll tmp = m + i; ll cnt = 0; rep(j, 60) if((tmp>>j) & 1) cnt++; if(i == cnt){ k = i; break; } } vector prime; for(ll i=2; i<=1000; i++){ bool flag = true; for(ll j=2; j*j<=i; j++){ if(i%j == 0){ flag = false; break; } } if(flag) prime.pb(i); } m += k; vector ans; rep(i, 60){ ll now = 0; if((m>>i) & 1){ rep(j, i) ans.pb(prime[now]); now++; } } cout << (ll)ans.size() << endl; rep(i, (ll)ans.size()) cout << ans[i] << " "; cout << endl; }