def combi2(c): return c * (c-1) / 2 def solve(N): if N == 0: return [1, "0"] p1set = {} count = 0 for i in range(2, 31): p1set[int(combi2(i))] = count count += 1 p2set = {} n = 1 count = 0 for i in range(1, 32): p2set[n] = count n *= 2 count += 1 zcount = 0 for n, d in sorted(p2set.items(), reverse=True): if N % n == 0: N /= n zcount = d while(N not in p1set): N *= 2 zcount -= 1 if N in p1set: break onecount = p1set[N] + 2 return [zcount + onecount, " ".join(["0"] * zcount + ["1"] * onecount)] if __name__ == "__main__": [print(a) for a in solve(int(input()))]