#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long n;
vector<pair<long long, long long> > ans;
int main() {
  long long i, j, k;
  cin >> n;
  for (i = 1; i <= 2000000; i++) {
    long long base = i * (i + 1) / 2 * (2 * i + 1) / 3;
    long long u = i * (i + 1) / 2;
    if (n < base) break;
    if (n == base) {
      ans.push_back(pair<long long, long long>(i, i));
      break;
    }
    if ((n - base) % u == 0) {
      ans.push_back(pair<long long, long long>(i, i + (n - base) / u));
      ans.push_back(pair<long long, long long>(i + (n - base) / u, i));
    }
  }
  sort((ans).begin(), (ans).end());
  printf("%d\n", ans.size());
  for (auto e : ans) printf("%lld %lld\n", e.first, e.second);
  return 0;
}
