K = int(input()) for N in range(2, 30 + 1): for i in range(2, N): if 2 ** (N - i) * (i * (i - 1) // 2) != K: continue print(N) print(*([0] * (N - i) + [1] * i)) exit()