12964 - Sierpiński carpet   

Description

Sierpiński carpet is a pattern that can generate by recursion.

The construction of the Sierpiński carpet begins with a square (its side length is the power of 3 and all the grids are coloerd white). The square is cut into 9 congruent subsquares in a 3-by-3 grid, and color the central subsquare by black. The same procedure is then applied recursively to the remaining 8 subsquares. Terminates when it recurse to the 1 by 1 square.

For instance, the following figures are the Sierpiński carpet with side length 3 and 9.

The following fugure is the Sierpiński carpet with side length 27.

Input

Input contains single integer n (1 <= n <= 7).

Output

Please output the Sierpiński carpet of side length 3and use '.' to represent white, '#' to represent black.

Sample Input  Download

Sample Output  Download

Tags




Discuss