#include #include using namespace std; typedef long long ll; int a[8] = {2,3,5,7,13,17,19,31}; int sum[110],d[2010]; ll pw(ll a,ll x){ ll ret = 1; while(x){ if(x&1) (ret *= a); (a *= a); x /= 2; } return ret; } int main(){ int i,j,k; for(i=0;i<(1<<8);i++){ int s = 0; for(j=0;j<8;j++){ if(i>>j&1) s += a[j]; } sum[s] = i; } for(i=1;i<=2000;i++){ for(j=i;j<=2000;j+=i) d[j] += i; } ll n; cin >> n; if(n==0){ cout << -1 << "\n"; return 0; } vector v; for(j=40;j>=0;j--){ if(n>>j&1){ if(sum[j]){ ll pro = 1; for(k=0;k<8;k++){ if(sum[j]>>k&1) pro *= pw(2,a[k]) - 1; } n ^= (1LL<=x && d[k]<2*x){ v.push_back(k); n ^= d[k]; break; } } } } } cout << v.size() << "\n"; for(ll x:v) cout << x << " "; cout << "\n"; }