New kitchen
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Zenyk decided to make a gift for Marichka. And what could be a better gift than covering the kitchen floor with new tiles?
The kitchen has a size of \(n \times m\) and consists of unit squares. Zenyk bought many tiles, but all of them have a size of \(1 \times 2\). Now he hesitates whether he will be able to cover the entire floor with tiles and please Marichka.
Find any tiling for Zenyk or determine that it is impossible to do.
Note that the tiles cannot be cut, but they can be rotated by 90 degrees.
Input
The single line contains two integers \(n\) and \(m\) — the height and width of the kitchen.
Output
If it is impossible to cover the entire floor, output a single number
-1. Otherwise, output \(n\) lines, each consisting of \(m\) uppercase English letters.
Letters indicate which tile covers the corresponding unit square. Identical letters denote the same tile, different ones denote different tiles.
Constraints
\(1 \le n, m \le 7\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 2 3 | AAC BBC |
| Input (stdin) | Output (stdout) |
|---|---|
| 1 1 | -1 |
Notes
In the second example, we have a kitchen that consists of a single square. Since the tile cannot be cut, the floor cannot be paved in any way.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|