inf = open("notation.in", "r")
ouf = open("notation.out", "w")

x = int(inf.readline())

a = []
while x != 0:
    a.append(x % 2)
    x = (x - x % 2) // (-2)

if len(a) == 0:
    a = [0]

print(len(a), file = ouf)
print(" ".join(map(str, a)), file = ouf)
