N = int(input()) cnt = 0 ans = [] for x in range(int(pow(N, 0.5)) + 1): for y in range(x + 1): if x == y == 0: continue if (N - x * y) % (x + y) == 0 and (N - x * y) / (x + y) >= 0: ans.append([x, y, (N - x * y) // (x + y)]) ans.append([y, x, (N - x * y) // (x + y)]) ans.append([x, (N - x * y) // (x + y), y]) ans.append([y, (N - x * y) // (x + y), x]) ans.append([(N - x * y) // (x + y), x, y]) ans.append([(N - x * y) // (x + y), y, x]) ans = list(map(list, set(map(tuple, ans)))) print(len(ans)) for i in range(len(ans)): print(*ans[i])