1677 - Virgo

Time Limit : 1 Second

Memory Limit : 512 MB

Submission: 24

Solved: 9


Minieye is a perfectionist company, as it has lots of Virgo employees. It is well known that Minieye is committed to how to use science and technology cleverly in driver assistance. Now the Virgo boss is going to build a building composed of some blocks. In order to motivate employees at any time to think about how to use of science and technology cleverly, the boss decided that each block should have the slogan HUST (how to use of science and technology). Unfortunately, the designers are Virgos, too. They believed that this design was very, very ugly and would rather die than drawing.

  As a creative programmer without drawing skills, you stare at the slogan HUST(how to use science and technology) for a few seconds, thinking carefully, and finally come up with an idea that to draw the sketch by yourself, using a text interface, basing a n rows and m columns table that describes the building.


Each block looks like:








The boss didn't want you to rotate or flip the blocks.What's more, he required that you must follow the following order when drawing:


Left and right







Up and down










Front and behind










To keep the sketch tidy, the blank should fill with "." as you see.




We have multiply cases. For each case:

The first line contains two integers, n, m.(1 <= n, m <= 30)

The second to n+1 line contains m integers each line, which is no more than 30, representing the number of blocks at corresponding gird. 


the picture pyy wants

sample input
2 2
1 0
2 1
sample output
© 2015 HUST ACMICPC TEAM. All Right Reserved.