#K67177. Unique Sequences Sum

    ID: 32585 Type: Default 1000ms 256MiB

Unique Sequences Sum

Unique Sequences Sum

Sarah loves to collect unique sequences of positive integers that sum up to a given number (N). Each sequence must be in non-decreasing order and the sequences should be printed in lexicographical order.

For example, when (N=5), the valid sequences are:
1 1 1 1 1
1 1 1 2
1 1 3
1 2 2
1 4
2 3
5

Your task is to generate all such sequences.

inputFormat

A single integer (N) representing the target sum. This integer is provided on standard input (stdin).

outputFormat

Output the valid sequences, one per line. Each sequence should consist of space-separated positive integers and be printed to standard output (stdout).## sample

3
1 1 1

1 2 3

</p>