N = int(input()) def f(x): return x * (x + 1) // 2 * x * (x + 1) // 2 A = [] for L in range(1,2*10**6): Y = N + f(L-1) ok,ng=L,5*10**7 while ng - ok > 1: m = (ok + ng) // 2 if f(m) <= Y: ok = m else: ng = m if f(ok) == Y: A.append([L,ok]) A.sort() print(len(A)) for a,b in A: print(a,b)