#include <bits/stdc++.h>
using namespace std;
struct arr {
  long long x, y;
};
long long n, ans;
inline long long js(long long x) { return x * (x + 1) * (2 * x + 1) / 6; }
vector<arr> a;
signed main() {
  scanf("%lld", &n);
  long long i = 1;
  bool flag = 0;
  while (js(i) <= n && i <= 2000000) {
    long long sum = js(i), add = i * (i + 1) / 2;
    if ((n - sum) % add == 0) {
      a.push_back((arr){i, i + (n - sum) / add});
      ans++;
      if (n == sum) flag = 1;
    }
    i++;
  }
  ans <<= 1;
  if (flag) ans--;
  printf("%lld\n", ans);
  for (long long i = 0; i < a.size(); i++)
    printf("%lld %lld\n", a[i].x, a[i].y);
  for (long long i = a.size() - 1; i >= 0; i--)
    if (a[i].x != a[i].y) printf("%lld %lld\n", a[i].y, a[i].x);
  return 0;
}
