N=int(input()) h=[0] c=0 for x in range(1,10**6+1): if x**3>N: break c+=x**3 h.append(c) from bisect import bisect_right c=0 result=[] for x in range(1,10**6+1): y=c+N pos=bisect_right(h,y) if h[pos-1]==y: result.append((x,pos-1)) c+=x**3 print(len(result)) for i in range(len(result)): a,b=result[i][:] print(a,b)