12993 - Patrick Star carpet   

Description

Patrick is a student in the prgramming course. After he solved the problem 12964 - Sierpiński carpet, he creates a pattern similar to Sierpinski carpet and name it as Patrick Star carpet because his name is Patrick and he is a star fish.

Patrick Star carpet is a square that its side length is the power of 3 and all the grids are coloerd white. The construction is described as follow.

For a Patrick Star carpet that its side length is three, color the 4 corner and the center one with black. For a Patrick star carpet with side length greater than 3, cut it into 9 congruent subsquares in a 3-by-3 grid, and then apply the same procedure to the subsquare at the four corner and the center, that is, put a Patrick Star carpet that its side length is the one-third of the original side length in the subsquares at the four corner and the center.  

For instance, the following figures are the Patrick Star carpet with side length 3 and 9.

The following fugure is the Patrick Star carpet with side length 27.

Input

Input contains only one line with single integer n (1 <= n <= 7).

Output

Output the Patrick Star carpet with side length 3and use '.' to represent white, '#' to represent black.
Remember to add a newline character at the end of line.

Sample Input  Download

Sample Output  Download

Tags




Discuss