from collections import * from functools import * from itertools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) def f(M): tmp = [] n = 1 while n**2 < M: if M%n==0: tmp.append(n) tmp.append(M//n) n += 1 if n**2==M: tmp.append(n) return tmp def g(M,S): X = [] for s in f(M+S**2): if s-S<0: continue t = (M+S**2)//s if t-S<0: continue X.append((s-S,t-S)) return X ans = [] M = math.ceil(math.sqrt(N)+1) for i in range(M+1): if i**2>N: break for x,y in g(N,i): tmp = [i,x,y] for p in permutations(tmp): ans.append(tuple(p)) ans = set(ans) print(len(ans)) for a in ans: print(*a)