Cubic Path
시간 제한2초메모리 제한256 MB
n차원 큐브에서 서로 다른 점들을 지나며, 부분집합으로 더 짧은 경로를 만들 수 없는 가장 긴 완전 경로를 찾는다.
문제
A path in the -dimensional set is a sequence of -dimensional points such that, for each (), points and differ in exactly one coordinate, and all the points are distinct. The length of the path is .
A path is imperfect if there exists a shorter path which leads from the first to the last point of this path and consists of a subset of the same points. In other words, , , and . If a path is not imperfect, it is perfect.
Your task is to find the longest perfect path in the set .
입력
The only line contains a single integer ().
출력
On the first line, print , the length of the path. On the next lines, print the description of the path : -th of these lines must contain characters (zeroes and ones) describing the point .
It is easy to see that there are multiple longest perfect paths. Print any one of them.