K=int(input()) one=[0,0] for i in range(2,31): one.append(i*(i-1)//2) zero=[1] for i in range(1,29): zero.append(2**i) ans0=0 ans1=0 for i in range(len(one)): for j in range(len(zero)): if one[i]*zero[j]==K: ans0,ans1=j,i break ans=[0]*ans0+[1]*ans1 print(len(ans)) print(*ans)