Kotlin Island

Dig whole rows and columns of an h by w grid so the dry cells form exactly n connected components, printing the lexicographically smallest plan.

Medium6GreedyImplementationCombinatoricsNo attempts yetTime limit3sMemory limit512 MB

Problem

An urban myth says that Peter the Great wanted a rectangular grid of channels on Kotlin island, where the town of Kronstadt stands today, like the one on Vasilyevskiy island.

Engineers (allegedly) brought the tsar this mathematical model. The island is a rectangular grid hh cells high and ww cells wide, and every cell is dry land at the start. The technology of the day allowed them to dig a channel across the whole island, and one dig turns an entire row or an entire column into water. A cell that is already water stays water.

Two dry cells are joined when they share a side. A connected component is a maximal set of dry cells linked by such steps. Propose a plan of the island whose dry land has exactly nn connected components.

Input

The only line contains three integers hh, ww, and nn: the height of the grid, its width, and the desired number of connected components (1h,w1001 \le h, w \le 100, 1n1091 \le n \le 10^9).

Output

If no plan has exactly nn connected components, print Impossible.

Otherwise print hh lines of ww characters each. A dot (.) is a dry land cell and a hash (#) is a water cell. Several plans can reach nn components, so print the lexicographically smallest one. Join the hh lines in order into a single string of h×wh \times w characters and compare those strings, treating # (ASCII 35) as smaller than . (ASCII 46).