You are given a positive integer n. Let N = {1, 2, ..., n}. A sequence A1, ..., Ak of subsets of N is called completely diversified if it satisfies all of the following conditions.
Terms of the sequence may be identical. For N = {1, 2, 3}, the sequence {1, 3}, {2, 3}, {2, 3} satisfies the conditions.
There may be many sequences that satisfy the conditions. Among them, a sequence with the smallest possible length k is called minimal. Given n, determine whether a completely diversified sequence exists. If it exists, output one minimal sequence.
Each line contains one positive integer n. The value of n is at most 100.
The input ends with a line containing 0, which must not be processed.
For each n, output the answer.
If no completely diversified sequence exists, output 0.
Otherwise, output the length of a minimal sequence on the first line, followed by one subset per line. Elements inside each subset must be written in increasing order, separated by single spaces. The subsets must be printed in lexicographic order.
Separate the output blocks for consecutive input values with one blank line. If several minimal answers exist, output any one of them.