#include <bits/stdc++.h>
using namespace std;
long long sol(long long n, long long t) {
  long long ret = n * (n + 1) * (2 * n + 3 * t + 1);
  ret /= 6;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long x;
  cin >> x;
  long long ans = 0;
  vector<pair<long long, long long> > aa;
  for (long long n = 1;; n++) {
    long long z = sol(n, 0);
    if (z > x) {
      break;
    }
    long long r = 6 * x - 2 * n * n * n - 3 * n * n - n;
    long long d = 3 * n * n + 3 * n;
    if (r % d == 0) {
      ans++;
      aa.push_back(make_pair(n, n + r / d));
    }
  }
  long long xx = aa.size();
  for (int i = 0; i < xx; i++) {
    if (aa[i].first != aa[i].second)
      aa.push_back(make_pair(aa[i].second, aa[i].first));
  }
  cout << aa.size() << "\n";
  sort(aa.begin(), aa.end());
  for (int i = 0; i < aa.size(); i++) {
    cout << aa[i].first << " " << aa[i].second << "\n";
  }
  return 0;
}
