import itertools n=int(input()) ans=set() for x in range(0,int(n**0.5)+10): for y in range(1,int(n**0.5)+10): if (n-x*y)%(x+y)==0: z=(n-x*y)//(x+y) if z>=0: for p in itertools.permutations([x,y,z]): ans.add(p) print(len(ans)) for i in ans: print(*i)