from itertools import permutations n = int(input()) ans = set() for x in range(0,int(n**0.5)+1): for y in range(max(x,1),int(n**0.5)+1): if (n-x*y)%(x+y)==0: z = (n-x*y)//(x+y) if y>z: break ans |= set(permutations((x,y,z))) print(len(ans)) for p in ans: print(*p)