binary strings of length are given. Construct one binary grid.
A path is a sequence of distinct cells such that every pair of consecutive cells shares a side.
Every given string must appear along at least one path of length in the constructed grid. Print the grid and one corresponding path for each string.
The input is given in the following format:
For each test case, first print the constructed binary grid in lines.
Then, for in order, print integers on one line. These are the cells of a path spelling , in order.
Each case is given in the following format:
If there are multiple solutions, print any of them.