Problem: Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked you to find all pairs of n and m, such that there are exactly x distinct squares in the table consisting of n rows and m columns. For example, in a 3 × 5 table there are 15 squares with side one, 8 squares with side two and 3 squares with side three. The total number of distinct squares in a 3 × 5 table is 15 + 8 + 3 = 26.

Input

The first line of the input contains a single integer x (1 ≤ x ≤ 1018) — the number of squares inside the tables Spongebob is interested in.

Output

First print a single integer k — the number of tables with exactly x distinct squares inside.

Then print k pairs of integers describing the tables. Print the pairs in the order of increasing n, and in case of equality — in the order of increasing m.

Examples

Input

26


Output

6
1 26
2 9
3 5
5 3
9 2
26 1


Input

2


Output

2
1 2
2 1


Input

8


Output

4
1 8
2 3
3 2
8 1

Note

In a 1 × 2 table there are 2 1 × 1 squares. So, 2 distinct squares in total.

<image>

In a 2 × 3 table there are 6 1 × 1 squares and 2 2 × 2 squares. That is equal to 8 squares in total.

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = 3.14159265359;
vector<long long> primes;
void GeneratingPrimes(int top) {
  vector<bool> p(top + 1, 1);
  p[0] = p[1] = 0;
  for (int i = 2; i <= sqrt(top); i++) {
    if (p[i]) {
      for (int j = i * i; j <= top; j += i) {
        p[j] = 0;
      }
    }
  }
  for (int i = 0; i < top + 1; i++)
    if (p[i]) primes.push_back(i);
}
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
void EXTgcd(long long a, long long b, long long& x0, long long& y0) {
  if (b == 0) {
    x0 = 1, y0 = 0;
    return;
  }
  EXTgcd(b, a % b, x0, y0);
  long long x1 = y0;
  long long y1 = x0 - (a / b) * (y0);
  y1 = y1;
  x0 = x1;
  y0 = y1;
}
long long power(long long n, long long p, long long mod) {
  if (!p) return 1;
  long long ans = 1;
  while (p > 1) {
    if (p & 1) ans = (ans * n) % mod;
    n = (n * n) % mod;
    p /= 2;
  }
  return (ans * n) % mod;
}
double dist(double a, double b, double x, double y) {
  return sqrt(pow(a - x, 2) + pow(b - y, 2));
}
double dist3(double a, double b, double c, double x, double y, double z) {
  return sqrt(pow(a - x, 2) + pow(b - y, 2) + pow(c - z, 2));
}
int xadd[9] = {1, -1, 0, 1, -1, 0, 1, -1, 0};
int yadd[9] = {1, -1, 0, -1, 0, 1, 0, 1, -1};
int xx[4] = {0, 1, 0, -1};
int yy[4] = {1, 0, -1, 0};
long long const N = 2e5 + 10;
long long const INF = 1e18;
long long const mod = 1000000007;
long long x, lastM = 1e13;
vector<pair<long long, long long>> ans;
int main() {
  cin >> x;
  for (unsigned long long n = 1; n <= 2e6 && n <= x && n <= lastM; n++) {
    unsigned long long b = (n * (n + 1)) / 2;
    unsigned long long a = (n * n * n - n) / 6;
    a += x;
    if (a % b == 0) {
      long long m = a / b;
      if (m < n)
        break;
      else
        ans.push_back(make_pair(n, m)), lastM = m;
    }
  }
  int s = ans.size();
  for (int i = 0; i < s; i++) {
    auto z = ans[i];
    if (z.first != z.second) ans.push_back(make_pair(z.second, z.first));
  }
  sort(ans.begin(), ans.end());
  cout << ans.size() << endl;
  for (auto z : ans) {
    printf("%lld %lld\n", z.first, z.second);
  }
  return 0;
}