K = int(input()) for i in range(1, 31): for j in range(31 - i): if K == i * (i - 1) // 2 *pow(2, j): print(i + j) print(*([1] * i +[0] * j)) exit(0)