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