Santa Claus has n candies, he dreams to give them as gifts to children.

What is the maximal number of children for whose he can give candies if Santa Claus want each kid should get distinct positive integer number of candies. Santa Class wants to give all n candies he has.

Input

The only line contains positive integer number n (1 ≤ n ≤ 1000) — number of candies Santa Claus has.

Output

Print to the first line integer number k — maximal number of kids which can get candies.

Print to the second line k distinct integer numbers: number of candies for each of k kid. The sum of k printed numbers should be exactly n.

If there are many solutions, print any of them.

Examples

Input

5


Output

2
2 3


Input

9


Output

3
3 5 1


Input

2


Output

1
2 
/** Class: SantaClausAndCandies.java
 *  @author Yury Park
 *  @version 1.0 <p>
 *  Course:
 *  Written / Updated: Jan 14, 2017
 *
 *  This Class - Santa Claus has n candies, he dreams to give them as gifts to children.
 *  What is the maximal number of children for whose he can give candies if Santa Claus want each kid should get
 *  distinct positive integer number of candies. Santa Class wants to give all n candies he has.
 *
 *  Input
 *  The only line contains positive integer number n (1 <= n <= 1000) — number of candies Santa Claus has.
 *
 *  Output
 *  Print to the first line integer number k — maximal number of kids which can get candies.
 *  Print to the second line k distinct integer numbers: number of candies for each of k kid.
 *  The sum of k printed numbers should be exactly n.
 *  If there are many solutions, print any of them.
 */
import java.util.*;

public class SantaClausAndCandies {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        /* Try greedy strategy.
         * Since each number of candies given must be distinct,
         * try the following sequence: 1, 2, 3, 4, ...
         * until the sum of the numbers would exceed n.
         * At that point, replace the last added number with another number such that
         * the sum of all the number would exactly equal n.
         *
         * For example, let's say no. of total candies = n = 11.
         * Then we begin giving out 1, 2, 3, 4, 5...
         * Notice that the fifth number in the above sequence would cause the total sum to be 1+2+3+4+5 = 15, which exceeds n.
         * So, we delete 5 from the list, and we replace 4 with the number that would cause the total sum to equal n=10.
         * So we replace 4 with 5 instead.
         * The final list becomes: 1, 2, 3, 5.
         * That is a total of 4 children who can each receive a distinct number of candies. */
        int count = 0;
        HashSet<Integer> candies = new HashSet<>();
        int lastAdded = -1;
        for (int i = 1; i <= N && N - i >= 0; ++i) {
            N -= i;
            count++;
            candies.add(i);
            lastAdded = i;
        }

        if (N == 0) {
            System.out.println(count);
        } else {		//if we get this far, candies.contains(N)
        	System.out.println(count);
        	candies.remove(lastAdded);
        	candies.add(lastAdded+N);
        }

        for (int c : candies) {
            System.out.print(c + " ");
        }
        sc.close();
    }
}

