K=int(input()) list=[] fin=0 if K!=0: N=2 while True: i=2 while i<=N: if (i*(i-1)/2)*2**(N-i)==K: fin=1 break i+=1 if fin==1: break N+=1 for y in range(N): if y+1<=i: list.append("1") else: list.append("0") output=" ".join(list) else: N=1 output="0" print(N) print(output)