#include #include using namespace std; int n,k,i,p; int main () { //freopen("input","r",stdin); //("output","w",stdout); scanf("%d",&n); while(n>0) { n/=2; k++; } p=1; printf("%d\n",k); for(i=1;i<=k;i++) { printf("%d ",p); p=p*2; } return 0; }