import math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) K = int(input()) if K == 0: print(0) for i in range(31): for j in range(2,31-i): if (2**i)*combinations_count(j,2) == K: print(i+j) print(*([0]*i+[1]*j)) exit()