import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 import itertools n = ii() ans = [] for x in range(1, n + 1): if x * x > n: break if n % x == 0: for v in itertools.permutations([0, n // x, x]): ans.append(tuple(v)) for x in range(1, n + 1): if x * x > n: break for y in range(1, n // x + 1): if (n - x * y) % (x + y) == 0: z = (n - x * y) // (x + y) for v in itertools.permutations([x, y, z]): ans.append(tuple(v)) ans = list(set(ans)) print(len(ans)) for v in ans: print(*v)