n = int(input()) m = 4000 r = [] for x in range(0,m): for y in range(x,m): if x==y==0: continue p = n - x*y q = x+y if p%q: continue z = p//q if z < y: break r += list(set([(x,y,z),(y,z,x),(z,x,y),(z,y,x),(y,x,z),(x,z,y)])) print(len(r)) for i in r: print(*i)