n = int(input()) m=0 for i in range(n+1): for j in range(n+1): for k in range(n+1): if (i*j + j*k + k*i) == n: m += 1 print(m) for i in range(n+1): for j in range(n+1): for k in range(n+1): if (i*j + j*k + k*i) == n: print(i,j,k,)