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.*;
import java.util.ArrayList;
import java.util.StringTokenizer;


public class ProblemA {
    public static void main(String[] args) {
        int testMode = 0;
        String testInput = "8";
        /*-------------------------------------------------------------------------------------------------------*/
        FastReader in = new FastReader(testMode == 0 ? System.in : new ByteArrayInputStream(testInput.getBytes()));
        PrintWriter out = new PrintWriter(System.out);
        new ProblemSolver().solve(in, out);
        out.close();
    }
}

class ProblemSolver {
    long N, M, S, R;

    void solve(FastReader in, PrintWriter out) {
        M = N = in.nextLong();
        S = 0;
        ArrayList<Pair> res = new ArrayList<>();
        long K = 0;
        for (long i = 1; i <= M; i++) {
            // (i-0)*(M+0)+(i-1)*(M-1)+(i-2)*(M-2)+(i-(i-1))*(M-i+1)= A + B
            // A = i*i*M -0 -M -2M -(i-1)*M = i*i*M - M*[i*(i-1)/2] = M [ (i*i+i)/2 ] = M * [ i*(i+1)/2 ]
            // B = 0-i-2i-(i-1)*i + 0+1+2*2+3*3+...+(i-1)*(i-1) = -i* i*(i-1)/2 + S
            // M = 2*[ N + i*i*(i-1)/2 - S] / [i*(i+1)]

            S += (i - 1) * (i - 1);
            M = (2 * (N + i * i * (i - 1) / 2 - S)) / (i * (i + 1));
            R = (2 * (N + i * i * (i - 1) / 2 - S)) % (i * (i + 1));
            if (R == 0 && M >= i) {
                res.add(new Pair(i, M));
                K += (i == M ? 1 : 2);
            }
        }
        out.println(K);
        for (int i = 0; i < res.size(); i++) out.println(res.get(i).a + " " + res.get(i).b);
        for (int i = res.size() - 1; i >= 0; i--)
            if (res.get(i).a != res.get(i).b) out.println(res.get(i).b + " " + res.get(i).a);
    }
}

class Pair implements Comparable<Pair> {
    public long a;
    public long b;

    public Pair(long a, long b) {
        this.a = a;
        this.b = b;
    }

    public int compareTo(Pair o) {
        if (this.a < o.a) return -1;
        if (this.a > o.a) return 1;
        if (this.b == o.b) return 0;
        return (int) ((this.b - o.b) / Math.abs(this.b - o.b));
    }
}


class FastReader extends BufferedReader {
    private StringTokenizer st;

    public FastReader(InputStream is) {
        super(new InputStreamReader(is));
    }

    public String nextToken() {
        try {
            while (st == null || !st.hasMoreElements()) {
                st = new StringTokenizer(readLine());
            }
            return st.nextToken();
        } catch (IOException e) {
            return null;
        }
    }

    public int nextInt() {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() {
        return Long.parseLong(nextToken());
    }

    public int[] nextArrayInt(int size) {
        int[] ret = new int[size];
        for (int i = 0; i < size; i++) {
            ret[i] = nextInt();
        }
        return ret;
    }
}