Cubic Path

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

문제

A path in the nn-dimensional set 0,1n\\{0, 1\\}^n is a sequence of nn-dimensional points x_1,x_2,,x_k0,1nx\_1, x\_2, \ldots, x\_k \in \\{0, 1\\}^n such that, for each ii (1ik11 \le i \le k - 1), points x_ix\_i and x_i+1x\_{i + 1} differ in exactly one coordinate, and all the points x_1,,x_kx\_1, \ldots, x\_k are distinct. The length of the path x_1,,x_kx\_1, \ldots, x\_k is kk.

A path  x_1,,x_kx\_1, \ldots, x\_k is imperfect if there exists a shorter path y_1,,y_y\_1, \ldots, y\_{\ell} which leads from the first to the last point of this path and consists of a subset of the same points. In other words, y_1,,y_x_1,,x_k\\{y\_1, \ldots, y\_{\ell}\\} \subseteq \\{x\_1, \ldots, x\_k\\}, x_1=y_1x\_1 = y\_1, x_k=y_x\_k = y\_{\ell} and <k\ell < k. If a path is not imperfect, it is perfect.

Your task is to find the longest perfect path in the set 0,1n\\{0, 1\\}^n.

입력

The only line contains a single integer nn (1n61 \le n \le 6).

출력

On the first line, print LL, the length of the path. On the next LL lines, print the description of the path x_1,,x_Lx\_1, \ldots, x\_L: ii-th of these lines must contain nn characters (zeroes and ones) describing the point x_ix\_i.

It is easy to see that there are multiple longest perfect paths. Print any one of them.