k = int(input()) if k == 0: print(0) exit() zero = 0 one = 0 for s in range(1, 31): for zero in range(s+1): one = s-zero if k == 2**(zero-1)*one*(one-1): print(s) print(*[0]*zero + [1]*one) exit()