K = int(input()) if K == 0: print(0) exit() for i in range(2,10**5+1): if K < (i*(i-1) // 2): break if K % (i*(i-1) // 2) == 0: c = K // (i*(i-1) // 2) if bin(c).count('1') == 1: n1 = i n0 = 0 while c > 1: c //= 2 n0 += 1 break ans = [1]*n1 + [0]*n0 print(len(ans)) print(*ans)