n = int(input()) a = [] for i in range(n.bit_length()): if n >> i & 1 != n & n >> i + 1 & 1: a.append(1 << i) if n != 0: print(len(a)) print(*a) else: print(-1)