# coding: utf-8 # Your code here! k = int(input()) lst = [] n1,n2 = 1,2 for i in range(29): lst.append(n1*n2//2) n1,n2 = n2,n2+1 def white(n,zero,one): s = "0 "*zero+"1 "*one print(n) print(s[:-1]) def f(): zero_pattern = 2 zero_cnt = 1 while True: yakusu = k//zero_pattern if yakusu in lst: one_cnt = lst.index(yakusu)+2 total_cnt =zero_cnt+one_cnt if 30>=total_cnt: white(total_cnt,zero_cnt,one_cnt) return zero_pattern *= 2 zero_cnt += 1 if k in lst: i = lst.index(k)+2 white(i,0,i) else: f()