N = int(input()) results = [] for x in range(1, int(N**0.5)+1): if N % x == 0: y, z = divmod(N, x) if z == 0 and y != x: results.append((x, y, 0)) results.append((y, x, 0)) print(len(results)) for result in results: print(*result)