#include <bits/stdc++.h>
using namespace std;
char _buf[1024];
int _bytes_read_ = 1024 - 1;
char *_s = _buf + _bytes_read_;
inline char getc1() {
  if (_s >= _buf + _bytes_read_) {
    _bytes_read_ = fread(_buf, 1, 1024 - 1, stdin);
    _buf[_bytes_read_] = 0;
    _s = _buf;
  }
  return *(_s++);
}
inline int readint() {
  char t = getc1();
  int n = 1, res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = 10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline unsigned long long readLL() {
  char t = getc1();
  int n = 1;
  unsigned long long res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = (unsigned long long)10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline char skipwhitespace() {
  char ch = getc1();
  while (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t') ch = getc1();
  return ch;
}
inline int readline(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != 0)) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline int readstr(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != ' ' && ch != '\t' && ch != 0)) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline string readstring(int n) {
  char buf[n + 1];
  readstr(buf);
  string s(buf);
  return s;
}
inline double readdouble() {
  char buf[40];
  readstr(buf);
  double d;
  sscanf(buf, "%lf", &d);
  return d;
}
inline long double readLD() {
  char buf[80];
  readstr(buf);
  long double d;
  sscanf(buf, "%Lf", &d);
  return d;
}
inline char readchar() { return skipwhitespace(); }
char outbuf[1024];
int outbuf_p;
inline void putc1(char ch) {
  if (outbuf_p >= 1024) {
    fwrite(outbuf, 1, 1024, stdout);
    outbuf_p = 0;
  }
  outbuf[outbuf_p++] = ch;
}
inline void flush() {
  fwrite(outbuf, 1, outbuf_p, stdout);
  outbuf_p = 0;
}
inline void writeint(int n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[10];
  int i = 9;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 10) putc1(buf[i]);
}
inline void writeLL(unsigned long long n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[25];
  int i = 24;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 25) putc1(buf[i]);
}
inline void writestr(char *s) {
  char *p = s;
  while (*p) {
    putc1(*p);
    p++;
  }
}
inline void writedouble(double d, int p) {
  char buf[40];
  sprintf(buf, "%.*f", p, d);
  writestr(buf);
}
double my_sqrt(double x, double delta = .00001) {
  double g = x / 2, ng;
  while (fabs(g - (ng = (x / g + g) / 2)) > delta) g = ng;
  return g;
}
template <class T>
void print(vector<T> v) {
  for (T i : v) cout << i << " ";
}
template <class T>
void fill(vector<T> v, T val = 0) {
  fill(v.begin(), v.end(), val);
}
vector<string> split(string S, string D) {
  vector<string> ar;
  int pos = 0, last = 0;
  while ((pos = S.find(D, last)) != string::npos) {
    string sub = S.substr(last, pos - last);
    if (sub.length() > 0) ar.push_back(sub);
    last = pos + D.length();
  }
  string sub = S.substr(last);
  if (sub.length() > 0) ar.push_back(sub);
  return ar;
}
inline unsigned long long pow(unsigned long long b, unsigned long long e) {
  unsigned long long ans = 1;
  while (e--) ans *= b;
  return ans;
}
inline unsigned long long pow(unsigned long long b, unsigned long long e,
                              unsigned long long mod) {
  unsigned long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * b % mod;
    b = b * b % mod;
    e >>= 1;
  }
  return ans;
}
template <class T>
T egcd(T a, T b, T &x, T &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  T x1, y1;
  T d = egcd(b % a, a, x1, y1);
  x = y1 - x1 * (b / a);
  y = x1;
  return d;
}
unsigned long long inv(unsigned long long a, unsigned long long m) {
  unsigned long long inv, y;
  assert(egcd(a, m, inv, y) == 1);
  if (inv < 0) inv += m;
  return inv;
}
inline unsigned long long gcd(unsigned long long a, unsigned long long b) {
  while (b) {
    unsigned long long t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int main() {
  unsigned long long x = readLL();
  set<pair<unsigned long long, unsigned long long> > v;
  unsigned long long cuberoot = pow(x, 1.0 / 3) + 10;
  cuberoot = min(cuberoot, (unsigned long long)sqrt(x) + 1);
  for (unsigned long long n = 1; n * (n + 1) * (2 * n + 1) / 6 <= x; n++) {
    unsigned long long y =
        2 * x + n * n * (n - 1) - n * (n - 1) * (2 * n - 1) / 3;
    if (y % (n * n + n) == 0) {
      unsigned long long m = y / (n * n + n);
      v.insert({n, m});
      v.insert({m, n});
    }
  }
  printf("%d\n", (int)v.size());
  for (auto i : v) printf("%llu %llu\n", i.first, i.second);
  return 0;
}

### Prompt

Generate a Cpp solution to the following 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>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
char _buf[1024];
int _bytes_read_ = 1024 - 1;
char *_s = _buf + _bytes_read_;
inline char getc1() {
  if (_s >= _buf + _bytes_read_) {
    _bytes_read_ = fread(_buf, 1, 1024 - 1, stdin);
    _buf[_bytes_read_] = 0;
    _s = _buf;
  }
  return *(_s++);
}
inline int readint() {
  char t = getc1();
  int n = 1, res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = 10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline unsigned long long readLL() {
  char t = getc1();
  int n = 1;
  unsigned long long res = 0;
  while (t != '-' && !isdigit(t)) t = getc1();
  if (t == '-') {
    n = -1;
    t = getc1();
  }
  while (isdigit(t)) {
    res = (unsigned long long)10 * res + (t & 15);
    t = getc1();
  }
  return res * n;
}
inline char skipwhitespace() {
  char ch = getc1();
  while (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t') ch = getc1();
  return ch;
}
inline int readline(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != 0)) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline int readstr(char *s) {
  char ch = skipwhitespace();
  int n = 0;
  while ((ch != '\n' && ch != ' ' && ch != '\t' && ch != 0)) {
    s[n++] = ch;
    ch = getc1();
  }
  s[n] = 0;
  return n;
}
inline string readstring(int n) {
  char buf[n + 1];
  readstr(buf);
  string s(buf);
  return s;
}
inline double readdouble() {
  char buf[40];
  readstr(buf);
  double d;
  sscanf(buf, "%lf", &d);
  return d;
}
inline long double readLD() {
  char buf[80];
  readstr(buf);
  long double d;
  sscanf(buf, "%Lf", &d);
  return d;
}
inline char readchar() { return skipwhitespace(); }
char outbuf[1024];
int outbuf_p;
inline void putc1(char ch) {
  if (outbuf_p >= 1024) {
    fwrite(outbuf, 1, 1024, stdout);
    outbuf_p = 0;
  }
  outbuf[outbuf_p++] = ch;
}
inline void flush() {
  fwrite(outbuf, 1, outbuf_p, stdout);
  outbuf_p = 0;
}
inline void writeint(int n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[10];
  int i = 9;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 10) putc1(buf[i]);
}
inline void writeLL(unsigned long long n) {
  int sign = n >= 0 ? 1 : -1;
  n = n > 0 ? n : -n;
  char buf[25];
  int i = 24;
  if (!n) buf[i--] = 48;
  while (n) {
    buf[i--] = n % 10 + 48;
    n /= 10;
  }
  if (sign < 0) putc1('-');
  while (++i < 25) putc1(buf[i]);
}
inline void writestr(char *s) {
  char *p = s;
  while (*p) {
    putc1(*p);
    p++;
  }
}
inline void writedouble(double d, int p) {
  char buf[40];
  sprintf(buf, "%.*f", p, d);
  writestr(buf);
}
double my_sqrt(double x, double delta = .00001) {
  double g = x / 2, ng;
  while (fabs(g - (ng = (x / g + g) / 2)) > delta) g = ng;
  return g;
}
template <class T>
void print(vector<T> v) {
  for (T i : v) cout << i << " ";
}
template <class T>
void fill(vector<T> v, T val = 0) {
  fill(v.begin(), v.end(), val);
}
vector<string> split(string S, string D) {
  vector<string> ar;
  int pos = 0, last = 0;
  while ((pos = S.find(D, last)) != string::npos) {
    string sub = S.substr(last, pos - last);
    if (sub.length() > 0) ar.push_back(sub);
    last = pos + D.length();
  }
  string sub = S.substr(last);
  if (sub.length() > 0) ar.push_back(sub);
  return ar;
}
inline unsigned long long pow(unsigned long long b, unsigned long long e) {
  unsigned long long ans = 1;
  while (e--) ans *= b;
  return ans;
}
inline unsigned long long pow(unsigned long long b, unsigned long long e,
                              unsigned long long mod) {
  unsigned long long ans = 1;
  while (e) {
    if (e & 1) ans = ans * b % mod;
    b = b * b % mod;
    e >>= 1;
  }
  return ans;
}
template <class T>
T egcd(T a, T b, T &x, T &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  T x1, y1;
  T d = egcd(b % a, a, x1, y1);
  x = y1 - x1 * (b / a);
  y = x1;
  return d;
}
unsigned long long inv(unsigned long long a, unsigned long long m) {
  unsigned long long inv, y;
  assert(egcd(a, m, inv, y) == 1);
  if (inv < 0) inv += m;
  return inv;
}
inline unsigned long long gcd(unsigned long long a, unsigned long long b) {
  while (b) {
    unsigned long long t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int main() {
  unsigned long long x = readLL();
  set<pair<unsigned long long, unsigned long long> > v;
  unsigned long long cuberoot = pow(x, 1.0 / 3) + 10;
  cuberoot = min(cuberoot, (unsigned long long)sqrt(x) + 1);
  for (unsigned long long n = 1; n * (n + 1) * (2 * n + 1) / 6 <= x; n++) {
    unsigned long long y =
        2 * x + n * n * (n - 1) - n * (n - 1) * (2 * n - 1) / 3;
    if (y % (n * n + n) == 0) {
      unsigned long long m = y / (n * n + n);
      v.insert({n, m});
      v.insert({m, n});
    }
  }
  printf("%d\n", (int)v.size());
  for (auto i : v) printf("%llu %llu\n", i.first, i.second);
  return 0;
}

```