def make_divisors(n): divisors = [] # 必要に応じてsetにしても良いかも i = 1 while i ** 2 <= n: if n % i == 0: divisors.append(i) if i ** 2 != n: divisors.append(n // i) i += 1 divisors.sort() return divisors from collections import defaultdict dic = defaultdict(int) for i in range(29): dic[pow(2, i)] = i N = int(input()) D = make_divisors(2 * N) ND = len(D) for i in reversed(range(ND - 1)): if D[i + 1] - D[i] == 1: if N % (D[i + 1] * D[i] // 2) == 0: if N // (D[i + 1] * D[i] // 2) in dic: nz = dic[N // (D[i + 1] * D[i] // 2)] no = D[i + 1] if no + nz <= 30: ans = [0] * nz + [1] * no print(len(ans)) print(*ans) exit()