N = int(input()) ans = [] num = 0 for x in range(N + 1): for y in range(N + 1): t = x * y if t > N:break if x + y == 0: if t == N: num += 1 ans.append((x,y,0)) else: if (N - t) % (x + y) == 0: num += 1 ans.append((x,y,(N - t) // (x + y))) print(num) for x,y,z in ans: print(x,y,z)