def f(x): if x == 0: return 0 sum = 0 i = 1 while i * i <= x: if x % i == 0: if i * i == x: sum += i else: sum += i sum += x // i i += 1 return sum N = int(input()) if N == 0: print(-1) else: found = False # Check if M=1 is possible for x in [N]: if f(x) == N and x < 2 * N: print(1) print(x) found = True break if not found: # Check if K can be represented as 12 XOR 28 = 16 K = N ^ 1 if K == 16: print(3) print(1, 6, 12) found = True if not found: # Try to find other a and b # For example, a=6, f(a)=12 a = 6 fa = f(a) target = K ^ fa b = None for x in [target - 1, target + 1, target * 2 - 1]: if x > 0: if f(x) == target: b = x break if b is not None and b != a and b != 1: sum_total = 1 + a + b if sum_total < 2 * N: print(3) print(1, a, b) found = True if not found: # Another attempt with a=3, f(a)=4 a = 3 fa = f(a) target = K ^ fa b = None for x in [target - 1, target + 1, target * 2 - 1]: if x > 0: if f(x) == target: b = x break if b is not None and b != a and b != 1: sum_total = 1 + a + b if sum_total < 2 * N: print(3) print(1, a, b) found = True if not found: print(-1)