Make Spoiled Binary Tree a Tree Again!

아직 제출이 없습니다시간 제한5초메모리 제한512 MB

문제

John had a beautiful complete binary tree with exactly 2k2^k leaves. Once he walked through his garden, and to his grave disappointment, there was a path going through all the leaves of his beautiful binary tree! 

The vertices of John's tree are numbered such that the root has number 11, and the direct successors of a vertex number ii are the vertices with numbers 2i2i and 2i+12i + 1. The new path spoiling John's tree consists of edges (v,v+1)(v, v + 1) for all consecutive pairs of leaves: more precisely, edges (2k,2k+1),(2k+1,2k+2),,(2k+12,2k+11)(2^k, 2^k + 1), (2^k + 1, 2^k + 2), \ldots, (2^{k + 1} - 2, 2^{k + 1} - 1). John denoted the set of vertices of his tree as VV and the set of edges (including the spoiling path) as EE.

John thought very hard about this problem and came up with a solution: he is going to merge some vertices of his spoiled binary tree such that the result is a tree (though not necessarily binary) again.

Formally, John will partition all vertices of his binary tree into disjoint sets S_1,,S_mS\_1, \ldots, S\_m. After that, for each set S_iS\_i, he will merge all vertices in it into a single new vertex ii. In the graph with new vertices 1,,m\\{1, \ldots, m\\}, an edge between ii and jj exists if and only if in the original graph, there was an edge between some vertex from S_iS\_i and some vertex from S_jS\_j.

John wants to find such sets S_1,,S_mS\_1, \ldots, S\_m that the new graph is a tree. Additionally, in order to make the tree beautiful, John wants the sets to be small enough: precisely, S_i8k|S\_i| \le 8 k for all i1,,mi \in \\{1, \ldots, m\\}. Help him find such sets.

입력

The only line contains a single integer kk (1k201 \le k \le 20).

출력

On the first line, print an integer mm (1m2k+111 \le m \le 2^{k+1} - 1): the number of sets of vertices John would like to have. In each of the next mm lines, print the size of the set, and then print the vertices in that set in any order. Each vertex of the tree should belong to exactly one of the printed sets, and the new graph with merged vertices should be a tree, as described in the statement.