Excursion#445

Excursion

2 seconds
64 megabytes
Hard

Excursions led by Ivan Petrovich are always very well organized. Ivan Petrovich especially likes arrangements in the form of a square because, if any student gets separated from the group, their absence is more noticeable in a square formation than in a line or single-file column. Therefore, the students are divided into several groups such that each group can form a square. To ensure that the different groups are easily distinguishable visually, each group must contain a different number of students. With students, you could make one group in a 10 \times 10 square, or two groups of 6 \times 6 and 8 \times 8, but Ivan Petrovich would prefer to form groups: 1 \times 1, 3 \times 3, 4 \times 4, 5 \times 5, and 7 \times 7.

Write a program that finds a partition of students into groups in the form of squares, in which no two groups have the same number of students. The number of groups in the partition should be as large as possible.

Input

The first line contains a single integer (1 \leq N \leq 10^5) — the number of students going on the excursion.

Output

If a partition exists, output in the first line the number of groups in the partition, and in the second line, in increasing order, the side lengths of the square groups. If there are multiple partitions with the maximum number of groups, output any of them. If no partition exists, output 0 on the first line.

Examples

Example 1

Loading
Loading