from collections import deque def shakutori(a: list, can_expand, expand, shrink, identity): n = len(a) res = identity() hi = -1 for lo in range(n): if lo > hi: hi = lo - 1 res = identity() # 必要な分だけ伸ばす while hi+1 < n and can_expand(res, a[hi+1]): res = expand(res, a[hi+1]) hi += 1 if lo <= hi: yield res, lo, hi res = shrink(res, a[lo]) # lo をひとつ進める # res に x を追加できるか def can_expand(res, x): return res + pow(x, 3) <= N # 伸ばす(res に x を追加) def expand(res, x): res += pow(x, 3) return res # 縮める(res から x を削除) def shrink(res, x): res -= pow(x, 3) return res N = int(input()) ans = [] a = [x for x in range(1, 10**6+10)] for res, l, r in shakutori(a, can_expand, expand, shrink, int): if res == N: ans.append((l+1, r+1)) print(len(ans)) for l, r in ans: print(l, r)