N = int(input()) ans = [] num = 0 for x in range(N + 1): for y in range(x,N + 1): t = x * y if t > N:break if x + y == 0: if t == N: num += 1 ans.append((x,y,0)) if x != y: ans.append((y,x,0)) num += 1 else: if (N - t) % (x + y) == 0: num += 1 z = (N - t) // (x + y) ans.append((x,y,z)) if x != y: ans.append((y,x,z)) num += 1 print(num) for x,y,z in ans: print(x,y,z)