Drawing
시간 제한1초메모리 제한512 MB
4n 곱하기 4m 크기의 토러스 격자에서 각 4x4 블록마다 정확히 a_ij개의 칸을 칠하되, 칠한 칸과 칠하지 않은 칸이 각각 연결되도록 배치를 출력한다.
문제
Math class was very boring, so Borya tried to find an entertainment. He had a cross-section paper which was divided into rows and columns. After each 4 rows he draw a line so paper was divided into big rows each consisting of 4 small rows. In the same way he split a columns into big ones. So he got paper divided into squares, each consisting of 16 small ones.
Borya suggested Misha to write down a number between 4 and 12 inclusive into each big cell. All those preparations were needed for testing Borya's drawing skills. He wanted to paint some of small cells in the way that some special conditions were satisfied.
Firstly Borya decided that it is too bad that some cells have four neighbors, but some have two or three. So Borya thought that first cell of each row is neighbor of last cell of this row. Similarly first and last cells of each column are neighbors.
All painted cells should form a connected figure. That means that for each two filled cells there should exist a path connecting them of filled cells where each pair of neighbor cells in path are neighbors on the paper (with considering Borya's decision that for each row and column first and last cells are neighbors).
Furthermore all not painted cells should form a connected figure.
Finally if Misha wrote down number in some big cell, exactly small cells should be painted in it.
Borya sure that despite of numbers Misha wrote he could fill out some cells that all conditions were satisfied. Proof that you are as good as Borya in painting!
입력
In the first line there are two integers and (). They means that Borya has a paper of size by cells.
Next lines contains integers --- number of small cells which should paint Borya in -th big cell of -th row.
출력
You are to print lines each consisting of symbols. About each small cell you should print symbol <<.>>, if Borya must not fill it and symbol <<*>>, if Borya should fill it.
If there are exist more than one solution, print any.