#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; if(m == 0){ cout << 1 << endl; return 0; } 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); } vector base(40); rep(i, 40) base[i] = (ll)pow(2, i)-1; vector fetch; ll now = 39; while(m){ if(base[now] <= m){ m -= base[now]; fetch.pb(now); }else{ now--; } } vector ans; rep(i, (ll)fetch.size()){ rep(j, fetch[i]) ans.pb(prime[i]); } cout << (ll)ans.size() << endl; rep(i, (ll)ans.size()) cout << ans[i] << " "; cout << endl; }