#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  set<pair<long long, long long> > vec;
  long long i = 1;
  while ((i * (i + 1) * (2 * i + 1)) / 6 <= n) {
    long long k = n - (i * (i + 1) * (2 * i + 1)) / 6;
    long long s = (i * (i + 1)) / 2;
    if (k % s == 0) {
      vec.insert(make_pair(i, i + k / s));
      vec.insert(make_pair(i + k / s, i));
    }
    i++;
  }
  cout << vec.size() << endl;
  for (set<pair<long long, long long> >::iterator it = vec.begin();
       it != vec.end(); it++) {
    cout << it->first << ' ' << it->second << endl;
  }
}
