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.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Set;
import java.util.StringTokenizer;

public class D {

	public static class Pair {
		long x, y;
		
		public Pair(long x, long y){
			this.x = x;
			this.y = y;
		}
		
		public boolean value_same(){
			return this.x == this.y;
		}
	}
	
	public static void main(String[] args) {

		try (final Scanner sc = new Scanner(System.in)) {
			final long n = sc.nextLong();
			final BigInteger big_n = BigInteger.valueOf(n);
			
			ArrayList<Pair> pairs = new ArrayList<Pair>();
			
			for(long y = 1; y <= Math.min(n, 2500000); y++){
				final BigInteger big_y = BigInteger.valueOf(y);
				final BigInteger sum = big_y.multiply(big_y.subtract(BigInteger.ONE)).multiply(big_y.add(BigInteger.ONE));
				final BigInteger mul = big_y.multiply(big_y.add(BigInteger.ONE));
				final BigInteger n_sum = big_n.add(sum.divide(BigInteger.valueOf(6)));
				
				//final long sum = (y - 1) * y * (y + 1) / 6;
				//final long mul = y * (y + 1) / 2;
				if(!n_sum.mod(mul.divide(BigInteger.valueOf(2))).equals(BigInteger.ZERO)){
					continue;
				}
				
				final BigInteger value = big_n.multiply(BigInteger.valueOf(6)).add(sum).divide(mul.multiply(BigInteger.valueOf(3)));
				if(big_y.compareTo(value) > 0){
					break;
				}
				
				pairs.add(new Pair(y, value.longValue()));
				//System.out.println(y + " : " + ((6 * n + y * (y + 1) * (y - 1)) / (3 * y * (y + 1))));
			}
			
			final int k = pairs.size() * 2 - (pairs.get(pairs.size() - 1).value_same() ? 1 : 0);
			
			System.out.println(k);
			for(int i = 0; i < pairs.size(); i++){
				System.out.println(pairs.get(i).x + " " + pairs.get(i).y);
			}
			for(int i = pairs.size() - 1; i >= 0; i--){
				if(pairs.get(i).value_same()){ continue; }
				System.out.println(pairs.get(i).y + " " + pairs.get(i).x);
			}
			
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() {
			try {
				while (!hasNext()) {
					tok = new StringTokenizer(br.readLine());
				}
			} catch (IOException e) { /* ignore */
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() {
			getLine();
			return tok.nextToken();
		}

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

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

		public void close() {
			try {
				br.close();
			} catch (IOException e) { /* ignore */
			}
		}
	}
}