import math K = int(input()) for i in range(1,31): d = K//(2**i) a = int(math.sqrt(d*2)) if a*(a+1) == d*2: print(i+a+1) arr = [0]*i + [1]*(a+1) print(*arr) exit()