N. Cellular Component Constellation
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

You are given two integers $$$N$$$ and $$$M$$$.

Output, in the format specified in the Output section, an $$$N \times N$$$ grid whose cells are colored either white or black and which satisfies the following conditions. If no such grid exists, print -1.

  • The sizes of the connected components of white cells appearing in the grid consist of exactly $$$M$$$ distinct values
  • The sizes of the connected components of black cells appearing in the grid consist of exactly $$$M$$$ distinct values

If there are multiple solutions, you may output any of them.

Input

The first line contains integers $$$N,M$$$ in this order, separated by spaces. ( $$$2 \leq N \leq 2000, 1 \leq M \leq 2000$$$ )

Output

If a grid satisfying the conditions exists, print $$$N$$$ lines. On the $$$i$$$-th of these lines $$$(1 \leq i \leq N)$$$, print a string $$$s_i$$$ of length $$$N$$$ as follows.

  • If the cell in row $$$i$$$, column $$$j$$$ $$$(1 \leq j \leq N)$$$ of the constructed grid is colored white, then the $$$j$$$-th character of $$$s_i$$$ must be .(dot).
  • If the cell in row $$$i$$$, column $$$j$$$ $$$(1 \leq j \leq N)$$$ of the constructed grid is colored black, then the $$$j$$$-th character of $$$s_i$$$ must be #.

If no grid satisfying the conditions exists, print -1 on the first line.

Examples
Input
4 2
Output
###.
..##
##.#
.##.
Input
2 3
Output
-1
Input
12 7
Output
.#..#.#.##.#
.#.#..#.##.#
.##...#.##.#
.#.#..#.##.#
.#..#.##..##
......######
######......
#...##..###.
#.##.#.#....
#...##.#....
#.####.#....
#.####..###.
Note

Two white cells $$$c_1,\ c_2$$$ are said to be connected if one can move from $$$c_1$$$ to $$$c_2$$$ by repeatedly moving to a vertically or horizontally adjacent cell and passing only through white cells.

A set $$$S$$$ of white cells is called a connected component if $$$S$$$ satisfies the following conditions.

  • Any two cells in $$$S$$$ are connected.
  • No white cell not contained in $$$S$$$ is connected to any cell contained in $$$S$$$.

Connected components of black cells are defined similarly.

For each connected component, its size is defined as the number of cells it contains.

Below is an appendix.

Explanation of Sample Output $$$1$$$

The sizes of the connected components of white cells are the two distinct values $$$1$$$ and $$$2$$$. The sizes of the connected components of black cells are also the two distinct values $$$4$$$ and $$$6$$$.

Figure for Sample Output $$$1$$$

Figure for Sample Output $$$3$$$