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