import math N=int(input()) lis=[] for x in range(math.ceil(math.sqrt(N))): for y in range(x,math.ceil(math.sqrt(N))): if x==0 and y==0: continue #print(x,y) z=-1 if (N-x*y)>0 and (N-x*y)/(x+y)%1==0: z=(N-x*y)//(x+y) elif N-x*y==0: z=0 if z!=-1: lis.append((x,y,z)) lis.append((x,z,y)) lis.append((y,x,z)) lis.append((y,z,x)) lis.append((z,x,y)) lis.append((z,y,x)) lis=set(lis) print(len(lis)) for l in lis: print(*l)