#include #include using namespace std; int two[20] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288}; int N, logarithm; int main(){ scanf("%d", &N); logarithm = floor(log(N) / log(2)); printf("%d\n", logarithm + 1); for(int i = 0; i <= logarithm; i++){ printf("%d ", two[i]); } return 0; }