#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000000ll * 1000000000ll;
const long long nmax = 1442251;
int main() {
  long long x;
  scanf("%I64d", &x);
  vector<long long> sumSqr(nmax);
  for (long long i = 1; i < nmax; ++i) {
    sumSqr[i] = sumSqr[i - 1] + i * i;
  }
  vector<pair<long long, long long> > ans;
  for (long long n = 1; n < nmax; ++n) {
    long long r = x - sumSqr[n - 1];
    long long t = n * (n - 1) / 2;
    r += t * n;
    if (r < 0) {
      continue;
    }
    r *= 2;
    if (r % (n * (n + 1))) {
      continue;
    }
    long long m = (r / n) / (n + 1);
    if (m < n) {
      continue;
    }
    ans.push_back(make_pair(n, m));
    if (n != m) {
      ans.push_back(make_pair(m, n));
    }
  }
  sort((ans).begin(), (ans).end());
  printf("%d\n", (int)(ans).size());
  for (int i = 0; i < (int)(ans).size(); ++i) {
    printf("%I64d %I64d\n", ans[i].first, ans[i].second);
  }
}
