K=int(input()) if K==0: print("0") else: list1=[] for i in range(1,30): if K%((i*(i+1))/2)==0: for j in range(30): if 2**j>1000000000: pass else: if K/((i*(i+1))/2)==2**j: ans=[i+1,j] print(sum(ans)) for k in range(i+1): list1.append("1") for l in range(j): list1.append("0") print(" ".join(list1)) exit()