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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.TreeSet;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastInputReader in = new FastInputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, FastInputReader in, PrintWriter out) {
            long n = in.nextLong();
            long MAXN = 0;
            for (; MAXN < n; MAXN++) {
                if (1l * MAXN * MAXN * MAXN > n) {
                    MAXN = (MAXN - 1) * 2;
                    break;
                }
            }

            TreeSet<Square> set = new TreeSet<>();
            for (int i = 1; i <= MAXN; i++) {
                long x = i;
                long t = n * 6 / (x * x + x);
                long y = (t - 1 + x) / 3;

                if (y < x) {
                    long tmp = y;
                    y = x;
                    x = tmp;
                }
                long square = x * (x + 1) * (3 * y - x + 1) / 6;

                if (square == n) {
                    set.add(new Square(x, y));
                    set.add(new Square(y, x));
                }
            }
            out.println(set.size());
            StringBuilder sb = new StringBuilder();
            for (Square s : set) {
                sb.append(s.x + " " + s.y);
                sb.append("\n");
            }
            out.print(sb);
        }

        class Square implements Comparable<Square> {
            long x;
            long y;

            public Square(long x, long y) {
                this.x = x;
                this.y = y;
            }


            public int compareTo(Square o) {
                int c = Long.compare(this.x, o.x);
                if (c != 0)
                    return c;
                return Long.compare(this.y, o.y);
            }

        }

    }

    static class FastInputReader {
        static InputStream is;
        static private byte[] buffer;
        static private int lenbuf;
        static private int ptrbuf;

        public FastInputReader(InputStream stream) {
            is = stream;
            buffer = new byte[1024];
            lenbuf = 0;
            ptrbuf = 0;
        }

        private int readByte() {
            if (lenbuf == -1)
                throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0)
                    return -1;
            }
            return buffer[ptrbuf++];
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
                ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

    }
}