#include <bits/stdc++.h>
using namespace std;
unsigned long long F[1005][1005];
pair<long long, long long> res[10000005];
int top;
int main() {
  long long n;
  cin >> n;
  long long tr = 1;
  for (long long i = 1; i * (i + 1) * (2 * i + 1) <= n * 6; ++i) {
    long long m = i * (i + 1) * (2 * i + 1) / 6;
    m = n - m;
    if (m % tr == 0) {
      top++;
      res[top].first = i;
      res[top].second = i + m / tr;
    }
    tr += (i + 1);
  }
  int tmp = top;
  for (int i = 1; i <= top; ++i) {
    ++tmp;
    res[tmp].first = res[i].second;
    res[tmp].second = res[i].first;
  }
  sort(res + 1, res + tmp + 1);
  top = tmp;
  int cnt = 0;
  for (int i = 1; i <= top; ++i)
    if (i == 1 || res[i].first != res[i - 1].first ||
        (res[i].first == res[i - 1].first &&
         res[i].second != res[i - 1].second))
      cnt++;
  cout << cnt << endl;
  for (int i = 1; i <= top; ++i)
    if (i == 1 || res[i].first != res[i - 1].first ||
        (res[i].first == res[i - 1].first &&
         res[i].second != res[i - 1].second))
      cout << res[i].first << " " << res[i].second << endl;
  return 0;
}
