k= int(input()) if k == 0: print(1) print(0) for n in range(2,31): for i in range(n+1): if i*(i-1)/2 * 2**(n-i) == k: print(n) print(" ".join(["0"]*(n-i)+["1"]*i)) break