Covering a board

You have an n×mn \times m board. In how many ways can you cover it with 1×21 \times 2 pieces?

Input

Input consists of nn and mm. You can assume 2nm522 \le nm \le 52, and that nmnm is even.

Output

Print in lexicographical order all the ways to cover the board. To distinguish the pieces, both cells must have the same lowercase letter, and all the pieces must have different letters. Appart from that, letters should be as small possible. Print an empty line after each solution.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:32:23.084Z

© Jutge.org, 2006–2026.
https://jutge.org